C3D-READCURB · Read whats on the curb layer error
Read-only: every entity on SS-V-ROAD-CURB with vertex count, length, and endpoints.
C# payload
// READ-ONLY: read what is actually on SS-V-ROAD-CURB in the drawing right now.
const string LAYER = "SS-V-ROAD-CURB";
int n = 0;
foreach (ObjectId id in ModelSpace)
{
var ent = Tx.GetObject(id, OpenMode.ForRead) as Entity;
if (ent == null || ent.Layer != LAYER) continue;
n++;
var p3 = ent as Polyline3d;
if (p3 != null)
{
var vs = new List<Point3d>();
foreach (ObjectId vid in p3)
{
var v = Tx.GetObject(vid, OpenMode.ForRead) as PolylineVertex3d;
if (v != null) vs.Add(v.Position);
}
double len = 0;
for (int i = 1; i < vs.Count; i++) len += vs[i].DistanceTo(vs[i-1]);
var s0 = vs.Count > 0 ? vs[0] : Point3d.Origin;
var s1 = vs.Count > 0 ? vs[vs.Count-1] : Point3d.Origin;
Log($"P3D h={ent.Handle} verts={vs.Count} len={len:F1} start=({s0.X:F2},{s0.Y:F2}) end=({s1.X:F2},{s1.Y:F2})");
}
else
{
Log($"{ent.GetType().Name} h={ent.Handle}");
}
}
Log($"Total {n} entities on {LAYER}.");
Result
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.