← Inbox

C3D-RWTXT · Road label + (R/W VARIES) done

Add R/W note to Stonewall Tell road text

Script file
C3D-RWTXT.cs
Target
active document · model space
Author
claude
Approved
yes · claude (session)
Timeout
60s

C# payload

// Road text rule: road name + R/W note. Update the Stonewall Tell label to add "(R/W VARIES)".
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
var ms = (BlockTableRecord)Tx.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);
int n = 0;
foreach (ObjectId id in ms) {
    if (Tx.GetObject(id, OpenMode.ForRead) is MText m && (m.Contents ?? "").ToUpperInvariant().Contains("STONEWALL")) {
        var w = (MText)Tx.GetObject(id, OpenMode.ForWrite);
        w.Contents = "STONEWALL TELL ROAD\\P(R/W VARIES)";
        n++;
        Log($"updated road label h={m.Handle}");
    }
}
Log($"road labels updated: {n}");

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

Log

updated road label h=20B9B
road labels updated: 1

Notes

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

No notes yet.