C3D-0120 · Linework: Face of wall [LW-FACE-OF-WALL] done
Face of wall as 2 polyline(s) on V-STRC-WALL, max 12 vertices, split at gaps over 45 ft, zero crossings verified against all other runs before posting. Points: 221,223; 235,239
C# payload
// Face of wall -> V-STRC-WALL
//
// survey-linework recipe. Points read from the drawing (C3D-0111), chained nearest-neighbour,
// then: split at any gap over 45 ft (the road is ~26 ft wide with shots every 5-40 ft, so a
// longer hop is a hole in the survey, not curb), capped at 12 vertices per polyline, and
// verified to have ZERO crossings against every other run before posting.
//
// Regular Polyline, never Polyline3d.
const string LAYER = "V-STRC-WALL";
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForWrite);
EnsureLayer(LAYER, 7);
{
var pl = new Polyline();
pl.AddVertexAt(0, new Point2d(2238288.1370, 1325091.5650), 0, 0, 0);
pl.AddVertexAt(1, new Point2d(2238252.5970, 1325104.7270), 0, 0, 0);
pl.Layer = LAYER;
ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl, true);
Log(String.Format(" polyline {0} verts, {1:F2} ft pts 221,223", pl.NumberOfVertices, pl.Length));
}
{
var pl = new Polyline();
pl.AddVertexAt(0, new Point2d(2238192.0170, 1325128.4340), 0, 0, 0);
pl.AddVertexAt(1, new Point2d(2238181.9330, 1325132.2510), 0, 0, 0);
pl.Layer = LAYER;
ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl, true);
Log(String.Format(" polyline {0} verts, {1:F2} ft pts 235,239", pl.NumberOfVertices, pl.Length));
}
int n = 0;
foreach (ObjectId id in ms) {
var e = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if (e != null && e.Layer == LAYER && e is Polyline) n++;
}
Log("V-STRC-WALL now holds " + n + " polyline(s) (verified)");
Ed.Regen();
Result
Log
polyline 2 verts, 37.90 ft pts 221,223 polyline 2 verts, 10.78 ft pts 235,239 V-STRC-WALL now holds 2 polyline(s) (verified)
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.