C3D-0575 · Recount SS- layer entities (read-only) done
Fresh count per SS- layer: top-level (model+layouts) and inside block definitions.
C# payload
Log("FILE="+System.IO.Path.GetFileName(Db.Filename));
var top=new System.Collections.Generic.Dictionary<string,int>(); var inblk=new System.Collections.Generic.Dictionary<string,int>();
var bt=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
foreach(ObjectId sid in bt){ var sp=(BlockTableRecord)Tx.GetObject(sid,OpenMode.ForRead); var d=sp.IsLayout?top:inblk; foreach(ObjectId e in sp){ if(e.IsErased) continue; var en=Tx.GetObject(e,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; if(en==null) continue; if(!d.ContainsKey(en.Layer)) d[en.Layer]=0; d[en.Layer]++; } }
var lt=(LayerTable)Tx.GetObject(Db.LayerTableId,OpenMode.ForRead); var names=new System.Collections.Generic.List<string>();
foreach(ObjectId id in lt){ var r=(LayerTableRecord)Tx.GetObject(id,OpenMode.ForRead); if(r.Name.StartsWith("SS-")) names.Add(r.Name); } names.Sort();
foreach(var n in names) Log(n+" top="+(top.ContainsKey(n)?top[n]:0)+" inBlocks="+(inblk.ContainsKey(n)?inblk[n]:0));
Result
Log
FILE=261001 - 5040 Rolling Rock Dr.dwg SS-0-FRAME top=0 inBlocks=1 SS-BOUNDARY top=1 inBlocks=1 SS-BOUNDARY BLUE top=4 inBlocks=5 SS-BOUNDARY CYAN top=2 inBlocks=2 SS-BOUNDARY LAND LOT top=34 inBlocks=34 SS-BOUNDARY MAG top=0 inBlocks=0 SS-BOUNDARY RED top=0 inBlocks=0 SS-BOUNDARY_PTS top=0 inBlocks=1 SS-BUFFER LANDSCAPE top=2 inBlocks=0 SS-BUFFER SETBACK top=0 inBlocks=0 SS-CL OF CREEK top=0 inBlocks=1 SS-FGT top=0 inBlocks=0 SS-FLOW WELL top=1 inBlocks=0 SS-HEATED AREA top=0 inBlocks=0 SS-OUTSITEPROP top=0 inBlocks=0 SS-PROPOSED top=0 inBlocks=0 SS-PROPOSED-DRIVE top=0 inBlocks=0 SS-SEWER LINE top=0 inBlocks=0 SS-TREES top=0 inBlocks=0 SS-V-BLDG-OTLN top=0 inBlocks=36 SS-V-BRKL-TOP top=0 inBlocks=2 SS-V-ROAD-CNTR top=0 inBlocks=0 SS-V-ROAD-CURB top=2 inBlocks=140 SS-V-ROAD-EPVM top=0 inBlocks=0 SS-X-FENCE top=0 inBlocks=0 SS-X-FENCE WOOD top=12 inBlocks=6
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.