← Inbox

C3D-0077 · Set the A14 to A12 slope label to 2.81% [SLOPE-A14-A12] done

Rewrites the N/A slope label on line 2EC87 (A14 to A12) to 2.81% from the segment table, targeted by handle 2EF5E and verified before writing.

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

C# payload

// Set the A14 -> A12 slope label (line 2EC87) to 2.81% from the user's segment table (7001->7002).
// Targeted by handle 2EF5E, verified to be the N/A label on SEWER_LINE_TEXT before writing.
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);

MText t = null;
foreach (ObjectId id in ms) {
    var o = Tx.GetObject(id, OpenMode.ForRead);
    if (o.Handle.ToString() == "2EF5E") { t = o as MText; break; }
}
if (t == null) { Log("ABORT: 2EF5E not found"); return; }
if (t.Layer != "SEWER_LINE_TEXT") { Log("ABORT: 2EF5E is on " + t.Layer); return; }

string was = t.Contents.Trim();
var w = (MText)Tx.GetObject(t.ObjectId, OpenMode.ForWrite);
w.Contents = "2.81%";
Log("  [2EF5E] A14->A12 slope  " + was + " -> 2.81%");

int na = 0;
foreach (ObjectId id in ms) {
    var mt = Tx.GetObject(id, OpenMode.ForRead) as MText;
    if (mt != null && mt.Layer == "SEWER_LINE_TEXT" && mt.Contents.Trim() == "N/A") na++;
}
Log("N/A labels remaining on SEWER_LINE_TEXT: " + na + " (verified)");
Ed.Regen();

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-0077 (0 entities touched).
Entities
Duration
592 ms
Civil 3D
25.0.0.0

Log

  [2EF5E] A14->A12 slope  N/A -> 2.81%
N/A labels remaining on SEWER_LINE_TEXT: 0 (verified)

Notes

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

No notes yet.