← Inbox

C3D-PARCELS · Draw 2 parcels as closed polylines done

Trace the 2 prop-line loops (Tract A + Tract B) into closed polylines on C-PROP-PARCEL; existing lines untouched. Areas logged for verification.

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

C# payload

// Draw the 2 parcels as closed polylines on C-PROP-PARCEL (existing lines untouched).
// Loops traced from the C-PROP-LINE geometry.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var ms = (BlockTableRecord)Tx.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
EnsureLayer("C-PROP-PARCEL", 4);
ObjectId Poly(Point2d[] v, string tag) {
    var pl = new Polyline(); for (int i = 0; i < v.Length; i++) pl.AddVertexAt(i, v[i], 0, 0, 0);
    pl.Closed = true; pl.Layer = "C-PROP-PARCEL"; ms.AppendEntity(pl); Tx.AddNewlyCreatedDBObject(pl, true);
    Log($"{tag}: h={pl.Handle} verts={v.Length} area={pl.Area:F0} sf ({pl.Area/43560:F2} ac)");
    return pl.ObjectId;
}
// Tract A (small quad)
Poly(new[] {
    new Point2d(2166620.54,1330516.18), new Point2d(2166662.31,1330721.98),
    new Point2d(2166872.29,1330718.97), new Point2d(2166820.21,1330505.22)
}, "PARCEL A");
// Tract B (big tract, wraps around A)
Poly(new[] {
    new Point2d(2166508.66,1330060.42), new Point2d(2166534.36,1330760.93),
    new Point2d(2166609.13,1330752.55), new Point2d(2166606.42,1330722.79),
    new Point2d(2166662.31,1330721.98), new Point2d(2166620.54,1330516.18),
    new Point2d(2166820.21,1330505.22), new Point2d(2166872.29,1330718.97),
    new Point2d(2166698.41,1330004.97)
}, "PARCEL B");
Log("2 parcel polylines drawn on C-PROP-PARCEL.");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260619 - 3625 Stonewall Tell Rd, Atlanta, GA 30349, USA\260619 - 3625 Stonewall Tell Rd.dwg
Message
Executed C3D-PARCELS (0 entities touched).
Entities
Duration
401 ms
Civil 3D
25.0.0.0

Log

PARCEL A: h=20CED verts=4 area=43295 sf (0.99 ac)
PARCEL B: h=20CEE verts=9 area=144358 sf (3.31 ac)
2 parcel polylines drawn on C-PROP-PARCEL.

Notes

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

No notes yet.