C3D-ESMTCHK2 · Inspect SS-ESMT-SSE20 contents (read-only) done
Check the Site/ParcelSegment on the old easement layer
C# payload
// Read-only: inspect what's on SS-ESMT-SSE20. It holds a Site + ParcelSegment (Civil 3D objects),
// which behave differently from plain geometry - a ParcelSegment's layer may be driven by its
// parent Site/Parcel style rather than being directly settable.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var ms = (BlockTableRecord)Tx.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);
foreach (ObjectId id in ms) {
var o = Tx.GetObject(id, OpenMode.ForRead);
var e = o as Autodesk.AutoCAD.DatabaseServices.Entity;
if (e == null || e.Layer != "SS-ESMT-SSE20") continue;
Log($"{o.GetType().FullName} handle={e.Handle} layer={e.Layer}");
try { var ex = e.GeometricExtents; Log($" extents ({ex.MinPoint.X:F1},{ex.MinPoint.Y:F1})-({ex.MaxPoint.X:F1},{ex.MaxPoint.Y:F1})"); } catch { Log(" (no extents)"); }
}
// also confirm what already made it onto SEWER_EASEMENT in the first pass
Log("--- SEWER_EASEMENT current contents ---");
foreach (ObjectId id in ms) {
var o = Tx.GetObject(id, OpenMode.ForRead);
var e = o as Autodesk.AutoCAD.DatabaseServices.Entity;
if (e == null || e.Layer != "SEWER_EASEMENT") continue;
if (o is Polyline pl) Log($" Polyline closed={pl.Closed} v={pl.NumberOfVertices} len={pl.Length:F1}");
else if (o is Line ln) Log($" Line len={ln.Length:F1}");
else Log($" {o.GetType().Name}");
}
Result
Log
Autodesk.Civil.DatabaseServices.Site handle=F46 layer=SS-ESMT-SSE20 extents (2296379.7,1279941.5)-(2296842.2,1280109.2) Autodesk.Civil.DatabaseServices.ParcelSegment handle=F4B layer=SS-ESMT-SSE20 extents (2296379.7,1279941.5)-(2296842.2,1280109.2) --- SEWER_EASEMENT current contents --- Line len=20.2
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.