C3D-0406 · READ-ONLY: content of WATER_LINE_PTS and SS-0-FRAME before erasing [C3D-WLPCHK] done
Reports top-level and in-block entity counts on WATER_LINE_PTS and SS-0-FRAME so the erase/delete is done knowingly.
C# payload
// Exact current content of WATER_LINE_PTS and SS-0-FRAME before any erase/delete.
Log("drawing: " + Db.Filename);
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
foreach (string L in new[]{"WATER_LINE_PTS","SS-0-FRAME"}){
int top=0, blk=0;
foreach (ObjectId bid in bt){ var def=(BlockTableRecord)Tx.GetObject(bid,OpenMode.ForRead); foreach (ObjectId sid in def){ var e=Tx.GetObject(sid,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; if(e==null||e.IsErased)continue; if(!e.Layer.Equals(L,StringComparison.OrdinalIgnoreCase))continue; if(def.IsLayout)top++; else blk++; } }
Log(string.Format("{0}: top-level={1} in-block-guts={2}", L, top, blk));
}
Result
Log
drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\ACAD-260612-C-Store As-Built 60 H2O wPROFILE.dwg WATER_LINE_PTS: top-level=0 in-block-guts=50 SS-0-FRAME: top-level=0 in-block-guts=4
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.