← Inbox

C3D-0494 · List layout viewports 260904 (read-only) [C3D-0495] done

Show each layout viewport center/height/scale to place the boundary on the layout.

Script file
C3D-0494.cs
Target
260904 - 920 W Sandtown Rd SW.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload


var lm=(DBDictionary)Tx.GetObject(Db.LayoutDictionaryId,OpenMode.ForRead);
foreach(System.Collections.DictionaryEntry de in lm){ string ln=(string)de.Key; if(ln=="Model") continue; var lay=(Layout)Tx.GetObject((ObjectId)de.Value,OpenMode.ForRead); var ps=(BlockTableRecord)Tx.GetObject(lay.BlockTableRecordId,OpenMode.ForRead); int vp=0; foreach(ObjectId eid in ps){ var v=Tx.GetObject(eid,OpenMode.ForRead) as Viewport; if(v==null||v.Number==1) continue; vp++; Log(ln+" vp#"+v.Number+" on="+v.On+" center="+v.ViewCenter.X.ToString("F0")+","+v.ViewCenter.Y.ToString("F0")+" H="+v.ViewHeight.ToString("F0")+" scale="+v.CustomScale.ToString("F5")); } if(vp==0) Log(ln+" (no paperspace viewport)"); }

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260904 - 920 W Sandtown Rd SW, Marietta, GA 30064, USA\260904 - 920 W Sandtown Rd SW.dwg
Message
Executed C3D-0494 (0 entities touched).
Entities
Duration
310 ms
Civil 3D
25.0.0.0

Log

11X17 vp#2 on=True center=982773,688208 H=655 scale=0.02500
HOUSEDIM vp#-1 on=False center=14,9 H=19 scale=1.00000
HOUSEDIM vp#-1 on=False center=2354969,1490786 H=328 scale=0.05000

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.