← Inbox

C3D-0119 · Linework: TBC road B right [LW-TBC-B-right] done

TBC road B right as 1 polyline(s) on SS-V-ROAD-CURB, max 12 vertices, split at gaps over 45 ft, zero crossings verified against all other runs before posting. Points: 215,212,211,203,286,202,281,280,268,267

Script file
C3D-0119.cs
Target
active document · model space
Author
claude
Approved
yes · reviewer
Timeout
180s

C# payload

// TBC road B right -> SS-V-ROAD-CURB
//
// 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 = "SS-V-ROAD-CURB";
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForWrite);
EnsureLayer(LAYER, 7);

    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2238387.7660, 1325130.7040), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2238370.0430, 1325162.5600), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2238368.0550, 1325165.8550), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2238351.4930, 1325189.1020), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2238328.6940, 1325215.6130), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2238325.4450, 1325219.0870), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2238303.2480, 1325237.8560), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2238277.5060, 1325257.0050), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2238251.6550, 1325271.1000), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2238246.9780, 1325275.5310), 0, 0, 0);
        pl.Layer = LAYER;
        ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl, true);
        Log(String.Format("  polyline {0} verts, {1:F2} ft  pts 215,212,211,203,286,202,281,280,268,267", 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("SS-V-ROAD-CURB now holds " + n + " polyline(s) (verified)");
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260802 - 4082 Sweetbriar Ln, Forest Park, GA 30297, USA\260802 - 4082 Sweetbriar Ln.dwg
Message
Executed C3D-0119 (0 entities touched).
Entities
Duration
476 ms
Civil 3D
25.0.0.0

Log

  polyline 10 verts, 205.61 ft  pts 215,212,211,203,286,202,281,280,268,267
SS-V-ROAD-CURB now holds 5 polyline(s) (verified)

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.