← Inbox

C3D-0118 · Linework: TBC road B left [LW-TBC-B-left] done

TBC road B left as 2 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: 217,218,208,207,206,205,284,200,283,277,276,275; 275,275,274,273,272,271,270,253,251

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

C# payload

// TBC road B left -> 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(2238366.3900, 1325113.7110), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2238357.0880, 1325133.3980), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2238347.7900, 1325147.5190), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2238345.2340, 1325151.1670), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2238344.2040, 1325154.0180), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2238331.0420, 1325172.5560), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2238311.5980, 1325195.2670), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2238307.7550, 1325199.3850), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2238288.0860, 1325216.7030), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2238264.8800, 1325233.8790), 0, 0, 0);
        pl.AddVertexAt(10, new Point2d(2238250.3390, 1325242.3300), 0, 0, 0);
        pl.AddVertexAt(11, new Point2d(2238246.3840, 1325243.5330), 0, 0, 0);
        pl.Layer = LAYER;
        ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl, true);
        Log(String.Format("  polyline {0} verts, {1:F2} ft  pts 217,218,208,207,206,205,284,200,283,277,276,275", pl.NumberOfVertices, pl.Length));
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2238246.3840, 1325243.5330), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2238246.3840, 1325243.5330), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2238239.3530, 1325244.1430), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2238233.3920, 1325243.8030), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2238227.2030, 1325241.0450), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2238222.0060, 1325236.8430), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2238219.9670, 1325233.5330), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2238218.0960, 1325229.7990), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2238213.7870, 1325218.8050), 0, 0, 0);
        pl.Layer = LAYER;
        ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl, true);
        Log(String.Format("  polyline {0} verts, {1:F2} ft  pts 275,275,274,273,272,271,270,253,251", 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-0118 (0 entities touched).
Entities
Duration
579 ms
Civil 3D
25.0.0.0

Log

  polyline 12 verts, 180.46 ft  pts 217,218,208,207,206,205,284,200,283,277,276,275
  polyline 9 verts, 46.36 ft  pts 275,275,274,273,272,271,270,253,251
SS-V-ROAD-CURB now holds 4 polyline(s) (verified)

Notes

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

No notes yet.