← Inbox

C3D-LW-WALL · Linework: wall done

6 surveyed points chained nearest-neighbour, breaking the run at a 150ft gap -> 1 polyline(s). Layer SS-ROAD-WALL.

Script file
C3D-LW-WALL.cs
Target
SS_BLOCK_22X17 · model space
Author
claude
Approved
yes · reviewer
Timeout
180s

C# payload

// WALL linework -> SS-ROAD-WALL
// 6 surveyed points chained nearest-neighbour, breaking the run at a 150ft gap -> 1 polyline(s).
// Regular Polyline only (never Polyline3d - cookbook 11); elevation = mean of each run.
// Host owns Tx; host regens after commit.
const string LAYER = "SS-ROAD-WALL";
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForWrite);
EnsureLayer(LAYER, 33);

    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296614.2, 1280063.16), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296613.05, 1280061.77), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296557.78, 1280009.95), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296557.79, 1280009.01), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296552.82, 1280009.06), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296552.89, 1280009.9), 0, 0, 0);
        pl.Closed = false;
        pl.Elevation = 728.97;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
        Log("  run 1: " + pl.NumberOfVertices + " verts, " + pl.Length.ToString("F1") + " ft");
    }

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-ROAD-WALL now holds " + n + " polyline(s) (verified)");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\SS_BLOCK_22X17.dwg
Message
Executed C3D-LW-WALL (0 entities touched).
Entities
Duration
303 ms
Civil 3D
25.0.0.0

Log

  run 1: 6 verts, 84.3 ft
SS-ROAD-WALL now holds 1 polyline(s) (verified)

Notes

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

No notes yet.