← Inbox

C3D-0213 · 260714 Huckaby: flip the WALL bulge signs (arcs were bowing the wrong way) done

The two V-STRC-WALL polylines had all-negative bulges, bowing each arc away from the surveyed points so the wall scalloped instead of curving. For every 3-point window the middle point sits LEFT of its chord, so all bulges must be POSITIVE. Magnitudes unchanged; edits both polylines in place by handle (20CCE, 20CCF). Verifies bulges on read-back, regen last.

Script file
C3D-0213.cs
Target
260714 - 285 Huckaby Rd.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// 260714 - fix the WALL bulges: they were NEGATIVE, bowing the arcs AWAY from the
// surveyed points ("hanging lights" scallop). Test that settles the sign: for each
// 3-point window, the middle point sits LEFT of the chord v0->v2, so every bulge is
// POSITIVE (AutoCAD: positive bulge = counterclockwise). Magnitudes are unchanged.
// Edits the two existing polylines in place by handle - no new geometry.
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);
Action<string,double[]> fix = (hs, bl) => {
    var h = new Handle(Convert.ToInt64(hs, 16));
    ObjectId id;
    if (!Db.TryGetObjectId(h, out id)) { Log("handle not found: " + hs); return; }
    var pl = (Polyline)Tx.GetObject(id, OpenMode.ForWrite);
    for (int i = 0; i < bl.Length && i < pl.NumberOfVertices; i++)
        pl.SetBulgeAt(i, bl[i]);
    var back = (Polyline)Tx.GetObject(id, OpenMode.ForRead);
    var sb = new System.Text.StringBuilder();
    for (int i = 0; i < back.NumberOfVertices; i++)
        sb.Append(string.Format("{0:F5} ", back.GetBulgeAt(i)));
    Log(string.Format("[{0}] {1} verts, len {2:F2}, bulges now: {3}(verified)",
        hs, back.NumberOfVertices, back.Length, sb.ToString()));
};
fix("20CCE", new double[] { 0.186999, 0.197398, 0.148791, 0.148791 });
fix("20CCF", new double[] { 0.146372, 0.213849, 0.086818, 0.091727, 0.091727 });
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd.dwg
Message
Executed C3D-0213 (0 entities touched).
Entities
Duration
996 ms
Civil 3D
25.0.0.0

Log

[20CCE] 5 verts, len 42.04, bulges now: 0.18700 0.19740 0.14879 0.14879 0.00000 (verified)
[20CCF] 6 verts, len 41.43, bulges now: 0.14637 0.21385 0.08682 0.09173 0.09173 0.00000 (verified)

Notes

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

No notes yet.