acad-layouts-viewports
Installation
SKILL.md
AutoCAD Layouts and Viewports
Use this skill when creating or managing paper space layouts, inserting and configuring viewports, switching between model space and paper space, setting viewport properties (scale, center, locked, layer overrides), or configuring plot settings on layouts.
Model Space vs Paper Space
AutoCAD drawings contain one model space and one or more paper space layouts. Each layout is backed by a BlockTableRecord.
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
// Model space block table record
BlockTableRecord modelSpace = (BlockTableRecord)tr.GetObject(
bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);