← Inbox

C3D-0434 · Fill FEMA fields on 11X17 - 281 Maranatha (job 260711) done

Set FIRM_PANEL 13135C0104F, FIRM_DATE 09/29/2006, FLOOD_ZONE X on SS_BLOCK_11X17 from surveydisco job 260711.

Script file
C3D-0434.cs
Target
260711 - 281 Maranatha Trail.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload


var map = new System.Collections.Generic.Dictionary<string,string>();
map["FIRM_PANEL"] = "13135C0104F";
map["FIRM_DATE"] = "09/29/2006";
map["FLOOD_ZONE"] = "X";
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
int changed=0;
foreach (ObjectId btrId in bt) {
    var space = (BlockTableRecord)Tx.GetObject(btrId, OpenMode.ForRead);
    foreach (ObjectId eid in space) {
        var br = Tx.GetObject(eid, OpenMode.ForRead) as BlockReference;
        if (br == null) continue;
        var bd = (BlockTableRecord)Tx.GetObject(br.BlockTableRecord, OpenMode.ForRead);
        if (bd.Name.IndexOf("SS_BLOCK_11X17", StringComparison.OrdinalIgnoreCase) < 0) continue;
        foreach (ObjectId arId in br.AttributeCollection) {
            var ar = Tx.GetObject(arId, OpenMode.ForRead) as AttributeReference;
            if (ar == null || !map.ContainsKey(ar.Tag)) continue;
            var w = (AttributeReference)Tx.GetObject(arId, OpenMode.ForWrite);
            string old=w.TextString; w.TextString=map[ar.Tag]; changed++;
            Log(ar.Tag + ": '" + old + "' -> '" + w.TextString + "'");
        }
    }
}
Log("changed="+changed);
Ed.Regen();

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260711 - 281 Maranatha Trail, Lawrenceville, GA 30045, USA\260711 - 281 Maranatha Trail.dwg
Message
Executed C3D-0434 (0 entities touched).
Entities
Duration
910 ms
Civil 3D
25.0.0.0

Log

FIRM_PANEL: '' -> '13135C0104F'
FIRM_DATE: '' -> '09/29/2006'
FLOOD_ZONE: '' -> 'X'
changed=3

Notes

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

No notes yet.