← Inbox

C3D-VICCHK · Verify vicinity map on 11X17 (read-only) done

Confirm exactly one raster is attached and where it sits vs the label

Script file
C3D-VICCHK.cs
Target
active document · model space
Author
claude
Approved
yes · claude (read-only inspection)
Timeout
60s

C# payload

// Read-only: confirm exactly ONE vicinity raster is on 11X17 and report its placement vs the label.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
foreach (ObjectId btrId in bt) {
    var b = (BlockTableRecord)Tx.GetObject(btrId, OpenMode.ForRead);
    if (!b.IsLayout) continue;
    var lay = (Layout)Tx.GetObject(b.LayoutId, OpenMode.ForRead);
    if (lay.LayoutName != "11X17") continue;
    int rasters = 0;
    foreach (ObjectId id in b) {
        var o = Tx.GetObject(id, OpenMode.ForRead);
        if (o is RasterImage ri) {
            var e = (Autodesk.AutoCAD.DatabaseServices.Entity)o;
            var org = ri.Orientation.Origin;
            Log($"RASTER handle={e.Handle} layer={e.Layer} origin=({org.X:F3},{org.Y:F3}) size=({ri.Width:F2}x{ri.Height:F2}) show={ri.ShowImage}");
            rasters++;
        }
        if (o is DBText t && (t.TextString ?? "").ToUpperInvariant().Contains("VICINITY"))
            Log($"LABEL @({t.Position.X:F3},{t.Position.Y:F3}) h={t.Height:F3} :: \"{t.TextString}\"");
    }
    Log($"11X17 raster count: {rasters}  (expect exactly 1)");
}

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260702 - 358 St Johns Ave SW, Atlanta, GA 30315, USA\260702 - 358 St Johns Ave SW.dwg
Message
Executed C3D-VICCHK (0 entities touched).
Entities
Duration
320 ms
Civil 3D
25.0.0.0

Log

LABEL @(0.652,3.392) h=0.057 :: "VICINITY MAP (NOT TO SCALE)"
RASTER handle=20BBC layer=BLOCK_CLOSURE origin=(0.652,3.467) size=(2.30x2.30) show=True
11X17 raster count: 1  (expect exactly 1)

Notes

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

No notes yet.