← Inbox

C3D-DRAWCL · Draw Road centerline done

Draws 1 straight-chord 3D polyline(s) from 9 CL points on layer SS-V-ROAD-CNTR.

Script file
C3D-DRAWCL.cs
Target
active document · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// Draw Road centerline linework from surveyed points. Chained by point number, broken on gaps.
// Straight-chord 3D polylines on existing layer SS-V-ROAD-CNTR. Host owns Tx/ModelSpace.
const string LAYER = "SS-V-ROAD-CNTR";
var chains = new List<List<(double e,double n,double z)>> {
    new List<(double,double,double)> { (2427880.33,1064741.96,411.94), (2427848.48,1064731.03,411.89), (2427807.86,1064716.8,412.54), (2427745.92,1064723.83,413.35), (2427767.33,1064653.49,412.63), (2427784.98,1064594.24,412.22), (2427778.99,1064565.27,412.81), (2427796.34,1064555.31,395.98), (2427799.17,1064529.55,396.14) },
};
EnsureLayer(LAYER);
int drawn = 0, ptsUsed = 0;
foreach (var chain in chains)
{
    var pl = new Polyline3d(Poly3dType.SimplePoly,
        new Point3dCollection(chain.Select(p => new Point3d(p.e, p.n, p.z)).ToArray()), false);
    pl.Layer = LAYER;
    ModelSpace.AppendEntity(pl);
    Tx.AddNewlyCreatedDBObject(pl, true);
    drawn++; ptsUsed += chain.Count;
}
Log($"Drew {drawn} polylines from {ptsUsed} CL points on '{LAYER}'.");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260709 - 1512 Bass Rd, Macon, GA 31210, USA\260709 - 1512 Bass Rd.dwg
Message
Executed C3D-DRAWCL (0 entities touched).
Entities
Duration
788 ms
Civil 3D
25.0.0.0

Log

Drew 1 polylines from 9 CL points on 'SS-V-ROAD-CNTR'.

Notes

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

No notes yet.