C3D-ESMTCHK · Inspect SS-ESMT-SSE20 contents (read-only) error
Check whether the Site/ParcelSegment on the old easement layer can be re-layered
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}");
if (o is Autodesk.Civil.DatabaseServices.ParcelSegment ps) {
try { Log($" ParcelSegment len={ps.Length:F2} startPt=({ps.StartPoint.X:F2},{ps.StartPoint.Y:F2})"); } catch { }
}
if (o is Autodesk.Civil.DatabaseServices.Site st) {
try { Log($" Site name='{st.Name}'"); } catch { }
}
}
// 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
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.