← Inbox

C3D-0026 · 30ft easement 473 to A4 incl PVC stub [EASE-30B] done

Offsets the sewer centerline 15ft each side for the 30ft easement: main leg 473->424->A12->A10->A9->A6->A5->A4 plus the 6in PVC stub arriving at A12. Test-MH connectors excluded. Nothing existing is erased.

Script file
C3D-0026.cs
Target
260612 · model space
Author
claude
Approved
yes · reviewer
Timeout
180s

C# payload

// 30ft sewer easement (15ft each side) around the sewer centerline, 473 -> A4.
//
// The centerline BRANCHES at A12 (2296604.65,1280046.20):
//   * main leg  473 -> 424 -> A12 -> A10 -> A9 -> A6 -> A5 -> A4   (754.36 ft)
//   * the 6" PVC stub arrives at A12 from the NW                    (55.10 ft)
// Both are part of the SAME easement - the stub is included, per the user. Only the two TEST-MH
// connectors are excluded (h=2E95F 12.07ft off 358, h=2EC92 8.66ft 353->A10).
// Everything past A4 (A3, A2, A1, MAIN) is out of scope.
//
// Each leg is offset +/-15.0 with Polyline.GetOffsetCurves so corners mitre properly. Existing
// entities on the layer are NOT touched - the user is clearing those.
// Host owns Tx; host regens after commit.
const string LAYER = "SEWER_EASEMENT";
const double HALF = 15.0;

var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForWrite);
EnsureLayer(LAYER, 3);

int made = 0;

    {
        var pl = new Polyline();
        pl.AddVertexAt(0, new Point2d(2296379.85, 1279953.52), 0, 0, 0);
        pl.AddVertexAt(1, new Point2d(2296511.25, 1279951.45), 0, 0, 0);
        pl.AddVertexAt(2, new Point2d(2296604.65, 1280046.2), 0, 0, 0);
        pl.AddVertexAt(3, new Point2d(2296690.96, 1280045.9), 0, 0, 0);
        pl.AddVertexAt(4, new Point2d(2296714.07, 1280025.3), 0, 0, 0);
        pl.AddVertexAt(5, new Point2d(2296827.25, 1280095.99), 0, 0, 0);
        pl.AddVertexAt(6, new Point2d(2296878.69, 1280034.22), 0, 0, 0);
        pl.AddVertexAt(7, new Point2d(2296980.45, 1279912.31), 0, 0, 0);
        Log("main leg 473->A4: " + pl.NumberOfVertices + " verts, " + pl.Length.ToString("F2") + " ft");
        foreach (double d in new double[] { HALF, -HALF })
        {
            try {
                foreach (Autodesk.AutoCAD.DatabaseServices.Entity oe in pl.GetOffsetCurves(d))
                {
                    oe.Layer = LAYER;
                    ms.AppendEntity(oe);
                    Tx.AddNewlyCreatedDBObject(oe, true);
                    var o = oe as Polyline;
                    Log("   offset " + d.ToString("F1") + " -> " + (o != null ? o.Length.ToString("F2") + " ft" : oe.GetType().Name));
                    made++;
                }
            } catch (System.Exception ex) { Log("   offset " + d + " FAILED: " + ex.Message); }
        }
        pl.Dispose();
    }

    {
        var sp = new Polyline();
        sp.AddVertexAt(0, new Point2d(2296549.94, 1280052.78), 0, 0, 0);
        sp.AddVertexAt(1, new Point2d(2296604.65, 1280046.2), 0, 0, 0);
        Log("PVC stub -> A12: " + sp.NumberOfVertices + " verts, " + sp.Length.ToString("F2") + " ft");
        foreach (double d in new double[] { HALF, -HALF })
        {
            try {
                foreach (Autodesk.AutoCAD.DatabaseServices.Entity oe in sp.GetOffsetCurves(d))
                {
                    oe.Layer = LAYER;
                    ms.AppendEntity(oe);
                    Tx.AddNewlyCreatedDBObject(oe, true);
                    var o = oe as Polyline;
                    Log("   offset " + d.ToString("F1") + " -> " + (o != null ? o.Length.ToString("F2") + " ft" : oe.GetType().Name));
                    made++;
                }
            } catch (System.Exception ex) { Log("   offset " + d + " FAILED: " + ex.Message); }
        }
        sp.Dispose();
    }

Log("drew " + made + " easement edge(s) at +/-" + HALF.ToString("F1") + " ft = " + (HALF*2).ToString("F0") + " ft easement");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260613 - 5030 E Lake Pkwy, Stockbridge, GA 30281, USA\260612 - CSTORE WATER ABS 30.dwg
Message
Executed C3D-0026 (0 entities touched).
Entities
Duration
367 ms
Civil 3D
25.0.0.0

Log

main leg 473->A4: 8 verts, 754.36 ft
   offset 15.0 -> 739.53 ft
   offset -15.0 -> 769.18 ft
PVC stub -> A12: 2 verts, 55.10 ft
   offset 15.0 -> 55.10 ft
   offset -15.0 -> 55.10 ft
drew 4 easement edge(s) at +/-15.0 ft = 30 ft easement

Notes

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

No notes yet.