← Inbox

C3D-LW-TBC4 · Linework: back of curb (12 verts, zero crossings) done

Erases SS-ROAD-TBC then redraws 26 polylines, max 12 vertices, verified 0 crossings (run-to-run and self) before posting. Only SS-ROAD-TBC is touched.

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

C# payload

// Back of curb -> SS-ROAD-TBC. ONLY this layer is touched.
//
// User's two hard rules after rejecting the first attempt ("those polylines are way too long
// and should never cross each other"):
//   * MAX 12 VERTICES per polyline
//   * NEVER cross - not another polyline, not itself
//
// ERASES SS-ROAD-TBC first so this cannot stack on a previous attempt (an earlier run left
// 2 strays and ended up with 28 polylines for 26 runs).
//
// Method: nearest-neighbour chain, 40ft break, hard 12-vertex cap; then every crossing is
// resolved by DROPPING the longer of the two offending segments (splitting that run there) and
// re-testing, until the count reaches zero. Dropping a segment loses a connection, never a
// point. Verified BEFORE posting: 0 run-to-run crossings, 0 self-crossings, 181 of 184 points
// used (3 fall into 1-point fragments after the splits).
// Regular Polyline (cookbook 11). Host owns Tx; host regens after commit.
const string LAYER = "SS-ROAD-TBC";
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForWrite);
EnsureLayer(LAYER, 3);

int erased = 0;
foreach (ObjectId id in ms) {
    var e = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
    if (e == null || e.Layer != LAYER) continue;
    var w = (Autodesk.AutoCAD.DatabaseServices.Entity)Tx.GetObject(id, OpenMode.ForWrite);
    w.Erase(); erased++;
}
Log("erased " + erased + " existing entity(ies) on " + LAYER);

    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296576.99, 1279960.46), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296584.61, 1279960.44), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296587.67, 1279960.73), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296594.69, 1279963.62), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296599.65, 1279968.6), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296601.75, 1279973.64), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296602.15, 1279994.07), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296606.77, 1280023.0), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296607.05, 1280034.86), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296604.66, 1280037.33), 0, 0, 0);
        pl.AddVertexAt(10, new Point2d(2296602.38, 1280034.9), 0, 0, 0);
        pl.AddVertexAt(11, new Point2d(2296615.49, 1280062.16), 0, 0, 0);
        pl.Elevation = 727.92;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296747.74, 1280099.76), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296745.18, 1280082.39), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296745.1, 1280082.35), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296715.57, 1280082.51), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296691.92, 1280077.44), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296691.63, 1280060.39), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296693.28, 1280058.71), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296694.65, 1280058.97), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296695.68, 1280059.56), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296698.41, 1280038.01), 0, 0, 0);
        pl.AddVertexAt(10, new Point2d(2296698.45, 1280037.89), 0, 0, 0);
        pl.AddVertexAt(11, new Point2d(2296698.55, 1280037.93), 0, 0, 0);
        pl.Elevation = 728.25;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296363.42, 1279929.09), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296372.02, 1279950.41), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296374.61, 1279955.02), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296379.07, 1279958.65), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296387.02, 1279960.81), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296394.86, 1279961.82), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296395.16, 1279993.98), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296392.63, 1279995.13), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296384.27, 1280000.92), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296373.9, 1280013.66), 0, 0, 0);
        pl.Elevation = 748.91;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296562.25, 1280195.59), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296562.18, 1280197.26), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296561.7, 1280198.67), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296557.85, 1280200.47), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296576.48, 1280230.34), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296580.22, 1280227.74), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296583.8, 1280229.12), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296584.54, 1280231.41), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296584.57, 1280245.39), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296584.61, 1280245.84), 0, 0, 0);
        pl.AddVertexAt(10, new Point2d(2296576.47, 1280245.81), 0, 0, 0);
        pl.AddVertexAt(11, new Point2d(2296558.5, 1280275.96), 0, 0, 0);
        pl.Elevation = 732.26;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296614.2, 1280063.16), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296617.11, 1280062.39), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296617.73, 1280063.13), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296617.63, 1280068.68), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296617.82, 1280077.63), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296596.61, 1280068.29), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296591.99, 1280072.37), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296590.22, 1280077.63), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296562.3, 1280056.16), 0, 0, 0);
        pl.Elevation = 728.64;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296802.06, 1280240.29), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296802.11, 1280240.22), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296797.9, 1280241.58), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296793.3, 1280244.25), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296793.28, 1280244.33), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296791.58, 1280246.63), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296817.1, 1280237.1), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296817.11, 1280237.03), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296817.09, 1280214.91), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296817.0, 1280198.59), 0, 0, 0);
        pl.Elevation = 730.39;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296509.58, 1280009.91), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296526.79, 1280009.91), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296552.82, 1280009.06), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296552.89, 1280009.9), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296557.78, 1280009.95), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296557.79, 1280009.01), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296557.87, 1280014.02), 0, 0, 0);
        pl.Elevation = 730.34;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296799.3, 1280162.84), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296799.36, 1280162.66), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296799.11, 1280154.65), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296799.08, 1280154.55), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296799.0, 1280154.54), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296776.75, 1280154.82), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296776.67, 1280151.84), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296776.69, 1280151.76), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296776.66, 1280151.7), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296761.66, 1280154.93), 0, 0, 0);
        pl.AddVertexAt(10, new Point2d(2296761.57, 1280154.84), 0, 0, 0);
        pl.AddVertexAt(11, new Point2d(2296759.32, 1280153.62), 0, 0, 0);
        pl.Elevation = 728.61;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296562.15, 1280126.98), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296562.12, 1280135.01), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296590.56, 1280136.58), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296595.08, 1280136.55), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296590.59, 1280131.47), 0, 0, 0);
        pl.Elevation = 728.65;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296725.56, 1280274.02), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296737.01, 1280271.15), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296743.82, 1280264.95), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296748.26, 1280252.73), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296746.81, 1280248.86), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296742.13, 1280245.67), 0, 0, 0);
        pl.Elevation = 732.92;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296866.71, 1280321.77), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296866.67, 1280324.82), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296900.69, 1280325.75), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296901.7, 1280325.86), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296901.47, 1280322.79), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296900.83, 1280322.76), 0, 0, 0);
        pl.Elevation = 730.66;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296480.01, 1279993.48), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296485.66, 1279990.19), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296490.19, 1279994.12), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296490.28, 1280009.87), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296479.87, 1280009.68), 0, 0, 0);
        pl.Elevation = 737.39;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296816.97, 1280184.92), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296816.83, 1280166.31), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296816.86, 1280166.23), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296806.46, 1280166.26), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296802.75, 1280166.15), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296802.24, 1280166.1), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296801.81, 1280166.08), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296801.05, 1280165.71), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296800.19, 1280165.35), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296799.66, 1280164.65), 0, 0, 0);
        pl.AddVertexAt(10, new Point2d(2296799.39, 1280163.78), 0, 0, 0);
        pl.AddVertexAt(11, new Point2d(2296799.41, 1280163.71), 0, 0, 0);
        pl.Elevation = 728.59;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296759.26, 1280153.4), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296758.52, 1280151.75), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296758.56, 1280151.68), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296758.83, 1280146.64), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296758.83, 1280146.4), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296759.23, 1280145.18), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296759.3, 1280145.1), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296761.2, 1280144.15), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296761.2, 1280144.09), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296762.92, 1280144.62), 0, 0, 0);
        pl.AddVertexAt(10, new Point2d(2296762.95, 1280144.64), 0, 0, 0);
        pl.AddVertexAt(11, new Point2d(2296765.5, 1280120.09), 0, 0, 0);
        pl.Elevation = 728.62;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296790.3, 1280252.25), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296790.34, 1280252.37), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296791.26, 1280258.04), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296792.5, 1280261.07), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296792.8, 1280261.69), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296795.65, 1280265.77), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296797.93, 1280267.97), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296800.58, 1280270.02), 0, 0, 0);
        pl.AddVertexAt(8, new Point2d(2296806.21, 1280272.51), 0, 0, 0);
        pl.AddVertexAt(9, new Point2d(2296806.52, 1280272.48), 0, 0, 0);
        pl.AddVertexAt(10, new Point2d(2296814.9, 1280274.57), 0, 0, 0);
        pl.AddVertexAt(11, new Point2d(2296814.96, 1280274.55), 0, 0, 0);
        pl.Elevation = 732.51;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296765.24, 1280119.69), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296787.3, 1280133.17), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296787.63, 1280133.24), 0, 0, 0);
        pl.Elevation = 728.87;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296737.44, 1280136.47), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296734.99, 1280136.45), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296734.65, 1280148.2), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296735.96, 1280150.46), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296737.49, 1280148.36), 0, 0, 0);
        pl.Elevation = 728.62;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296795.75, 1280320.9), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296795.69, 1280323.8), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296808.17, 1280323.86), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296808.03, 1280320.84), 0, 0, 0);
        pl.Elevation = 733.79;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296689.46, 1280037.23), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296688.62, 1280036.82), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296686.3, 1280035.65), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296685.69, 1280034.91), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296684.6, 1280032.42), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296684.55, 1280032.4), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296683.75, 1280021.51), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296683.83, 1280021.42), 0, 0, 0);
        pl.Elevation = 727.92;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296415.75, 1280009.0), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296415.68, 1279992.09), 0, 0, 0);
        pl.Elevation = 745.25;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296965.01, 1280327.59), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296964.74, 1280330.58), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296972.76, 1280331.13), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296973.23, 1280328.13), 0, 0, 0);
        pl.Elevation = 727.49;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296557.55, 1279995.0), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296554.91, 1279991.13), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296552.55, 1279995.27), 0, 0, 0);
        pl.Elevation = 729.37;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296595.15, 1280147.52), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296590.71, 1280148.44), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296592.56, 1280151.8), 0, 0, 0);
        pl.Elevation = 728.60;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296456.54, 1280327.77), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296454.33, 1280325.94), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296456.33, 1280324.64), 0, 0, 0);
        pl.Elevation = 741.44;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296554.44, 1280323.42), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296554.79, 1280326.43), 0, 0, 0);
        pl.Elevation = 739.40;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }
    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296816.39, 1280275.0), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296816.5, 1280274.91), 0, 0, 0);
        pl.Elevation = 731.90;
        pl.Layer = LAYER;
        ms.AppendEntity(pl);
        Tx.AddNewlyCreatedDBObject(pl, true);
    }

int n = 0, maxv = 0; double tot = 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.IsErased) continue;
    var p = e as Polyline; if (p == null) continue;
    n++; tot += p.Length;
    if (p.NumberOfVertices > maxv) maxv = p.NumberOfVertices;
}
Log("SS-ROAD-TBC: " + n + " polylines, " + tot.ToString("F0") + " ft, max " + maxv + " verts (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-TBC4 (0 entities touched).
Entities
Duration
428 ms
Civil 3D
25.0.0.0

Log

erased 28 existing entity(ies) on SS-ROAD-TBC
SS-ROAD-TBC: 26 polylines, 1164 ft, max 12 verts (verified)

Notes

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

No notes yet.