C3D-0527 · Verify 22x17 refit (read-only) [C3D-0528] done
Read back title block extents and check every on-sheet entity on the 22 layouts lies within 22x17 paper.
C# payload
string F(double d){ return d.ToString("F2"); }
var lm=(DBDictionary)Tx.GetObject(Db.LayoutDictionaryId,OpenMode.ForRead);
foreach(System.Collections.DictionaryEntry de in lm){ string ln=(string)de.Key; if(!ln.Contains("22")) continue;
var lay=(Layout)Tx.GetObject((ObjectId)de.Value,OpenMode.ForRead); var ps=(BlockTableRecord)Tx.GetObject(lay.BlockTableRecordId,OpenMode.ForRead);
int inside=0, out1=0;
foreach(ObjectId eid in ps){ if(eid.IsErased) continue; var e=Tx.GetObject(eid,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; if(e==null) continue; if(e is Viewport v0 && v0.Number==1) continue;
Extents3d x; try{x=e.GeometricExtents;}catch{continue;}
double x0=x.MinPoint.X,y0=x.MinPoint.Y,x1=x.MaxPoint.X,y1=x.MaxPoint.Y;
if(e is Viewport v){ x0=v.CenterPoint.X-v.Width/2; x1=v.CenterPoint.X+v.Width/2; y0=v.CenterPoint.Y-v.Height/2; y1=v.CenterPoint.Y+v.Height/2; }
if(e is BlockReference br){ var bd=(BlockTableRecord)Tx.GetObject(br.BlockTableRecord,OpenMode.ForRead); if(bd.Name.StartsWith("SS_BLOCK")) Log(ln+" TB "+bd.Name+" ext "+F(x0)+","+F(y0)+" -> "+F(x1)+","+F(y1)); }
bool farOff = x1< -0.5 || x0>22.5 || y1< -0.5 || y0>17.5; if(farOff) continue; // parked off-sheet, left alone
bool inPaper = x0>=-0.01&&y0>=-0.01&&x1<=22.01&&y1<=17.01; if(inPaper) inside++; else { out1++; Log(" OVERHANG "+e.GetType().Name+" "+e.Handle+" "+F(x0)+","+F(y0)+" -> "+F(x1)+","+F(y1)); }
}
Log(ln+": on paper="+inside+" overhanging="+out1);
}
Result
Log
22X17 (2) TB SS_BLOCK_22X17_TB ext 0.33,0.33 -> 21.67,16.67 OVERHANG Line 23880 -0.03,8.49 -> 2.50,8.49 OVERHANG Ole2Frame 23881 -0.03,8.49 -> 2.50,11.02 22X17 (2): on paper=141 overhanging=2 COVER (22) TB SS_BLOCK_22X17_TB ext 0.33,0.33 -> 21.67,16.67 OVERHANG Viewport 238A0 -1.58,0.30 -> 18.22,11.05 OVERHANG Line 238AA -0.03,8.49 -> 2.50,8.49 OVERHANG Ole2Frame 238AB -0.03,8.49 -> 2.50,11.02 COVER (22): on paper=37 overhanging=3
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.