← Inbox

C3D-0287 · Grand Springs: find the FIRM PANEL box on 01-Cover done

READ-ONLY. Locates the FIRM PANEL label and every entity in the region above it, to size the box that should hold the FEMA flood map.

Script file
C3D-0287.cs
Target
SS-23014S-The Grand Springs-Final Plat.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

// The "FIRM PANEL" label on 01-Cover and whatever box sits above it.
Log("drawing: " + Db.Filename);
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
foreach (ObjectId btrId in bt) {
    var rec = (BlockTableRecord)Tx.GetObject(btrId, OpenMode.ForRead);
    if (!rec.IsLayout) continue;
    var lay = (Layout)Tx.GetObject(rec.LayoutId, OpenMode.ForRead);
    if (lay.LayoutName != "01-Cover") continue;

    // the label
    ObjectId lblId = ObjectId.Null;
    Extents3d lbl = new Extents3d();
    foreach (ObjectId id in rec) {
        var dt = Tx.GetObject(id, OpenMode.ForRead) as DBText;
        if (dt == null) continue;
        if (dt.TextString.Trim().ToUpper() != "FIRM PANEL") continue;
        lblId = id; lbl = dt.GeometricExtents;
        Log(string.Format("LABEL [{0}] \"{1}\" ({2:F3},{3:F3})-({4:F3},{5:F3}) h={6:F3} layer={7}",
            dt.Handle, dt.TextString, lbl.MinPoint.X, lbl.MinPoint.Y, lbl.MaxPoint.X, lbl.MaxPoint.Y, dt.Height, dt.Layer));
    }
    if (lblId.IsNull) { Log("FIRM PANEL label not found"); return; }

    // anything overlapping the column above the label
    double lx0 = lbl.MinPoint.X - 4.0, lx1 = lbl.MaxPoint.X + 8.0;
    double ly0 = lbl.MaxPoint.Y - 0.2, ly1 = lbl.MaxPoint.Y + 14.0;
    Log("");
    Log(string.Format("scanning the region ({0:F2},{1:F2})-({2:F2},{3:F2}) above the label:", lx0, ly0, lx1, ly1));
    foreach (ObjectId id in rec) {
        var ent = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
        if (ent == null || id == lblId) continue;
        double x0,y0,x1,y1;
        try { var e = ent.GeometricExtents; x0=e.MinPoint.X;y0=e.MinPoint.Y;x1=e.MaxPoint.X;y1=e.MaxPoint.Y; } catch { continue; }
        if (x1 < lx0 || x0 > lx1 || y1 < ly0 || y0 > ly1) continue;
        string what = ent.GetType().Name;
        var pl = ent as Polyline;
        if (pl != null) what = string.Format("Polyline verts={0} closed={1}", pl.NumberOfVertices, pl.Closed);
        var dt2 = ent as DBText; if (dt2 != null) what = "TEXT \"" + dt2.TextString + "\"";
        var mt = ent as MText; if (mt != null) what = "MTEXT \"" + mt.Contents.Replace("\n"," ").Substring(0,Math.Min(40,mt.Contents.Length)) + "\"";
        var br = ent as BlockReference; if (br != null) what = "BLOCK " + br.Name;
        var ri = ent as RasterImage; if (ri != null) what = "*** RASTERIMAGE";
        var ol = ent as Ole2Frame; if (ol != null) what = "*** OLE";
        Log(string.Format("  [{0}] {1,-46} ({2:F3},{3:F3})-({4:F3},{5:F3}) {6:F2}x{7:F2} layer={8}",
            ent.Handle, what, x0,y0,x1,y1, x1-x0, y1-y0, ent.Layer));
    }
}

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260706 - 3460 Mathis Airport Pkwy, Suwanee, GA 30024, USA\Final plat\SS-23014S-The Grand Springs-Final Plat.dwg
Message
Executed C3D-0287 (0 entities touched).
Entities
Duration
759 ms
Civil 3D
25.0.0.0

Log

drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260706 - 3460 Mathis Airport Pkwy, Suwanee, GA 30024, USA\Final plat\SS-23014S-The Grand Springs-Final Plat.dwg
LABEL [2DE3] "FIRM PANEL" (47.347,1.589)-(49.661,1.695) h=0.101 layer=T-BLOCK

scanning the region (43.35,1.50)-(57.66,15.70) above the label:
  [27AB] Viewport                                       (16.256,3.079)-(105.084,28.981) 88.83x25.90 layer=0
  [27C7] BLOCK 24X36 CORNERS                            (31.805,0.288)-(67.302,23.758) 35.50x23.47 layer=T-BLOCK
  [27E3] Line                                           (53.448,11.655)-(57.468,11.655) 4.02x0.00 layer=T-BLOCK
  [27E4] Line                                           (53.440,10.312)-(57.471,10.312) 4.03x0.00 layer=T-BLOCK
  [27E5] Line                                           (53.445,10.751)-(57.468,10.751) 4.02x0.00 layer=T-BLOCK
  [27E6] TEXT "        OWNER"                           (53.428,11.538)-(53.751,11.605) 0.32x0.07 layer=T-BLOCK
  [27E7] TEXT "        SIGNED, SEALED AND DELIVERED"    (53.428,11.190)-(55.085,11.270) 1.66x0.08 layer=T-BLOCK
  [27E8] TEXT "        IN THE PRESENCE OF:"             (53.428,11.091)-(54.546,11.158) 1.12x0.07 layer=T-BLOCK
  [27E9] TEXT "        WITNESS"                         (53.428,10.644)-(53.827,10.711) 0.40x0.07 layer=T-BLOCK
  [27EA] TEXT "        NOTARY PUBLIC"                   (53.428,10.197)-(54.220,10.264) 0.79x0.07 layer=T-BLOCK
  [27F8] MTEXT "THE OWNER OF LAND SHOWN ON THIS PLAT AND" (52.943,12.096)-(57.540,12.722) 4.60x0.63 layer=T-BLOCK
  [2800] Polyline verts=4 closed=True                   (32.947,0.735)-(64.235,23.360) 31.29x22.63 layer=T-BLOCK
  [280E] Polyline verts=4 closed=True                   (52.836,9.367)-(58.025,12.879) 5.19x3.51 layer=T-BLOCK
  [2813] Line                                           (52.515,13.045)-(52.515,16.486) 0.00x3.44 layer=T-BLOCK
  [2814] MTEXT "As required by subsection (d) of O.C.G.A" (52.641,14.591)-(58.474,15.844) 5.83x1.25 layer=T-BLOCK
  [2817] Line                                           (52.515,13.045)-(58.553,13.045) 6.04x0.00 layer=T-BLOCK
  [288B] MTEXT "\P\P(A) DEED BOOK AND PAGE REFERENCE TO " (40.347,15.307)-(45.920,16.100) 5.57x0.79 layer=T-BLOCK
  [2CB5] MTEXT "{\fTimes New Roman|b0|i0|c0|p18;\P \P\H1" (46.459,15.498)-(51.447,16.312) 4.99x0.81 layer=T-BLOCK
  [2DE2] Line                                           (47.322,1.535)-(49.702,1.535) 2.38x0.00 layer=T-BLOCK
  [3AD9] TEXT "SCALE 1"=1000'"                          (50.667,1.572)-(52.198,1.715) 1.53x0.14 layer=T-BLOCK
  [3ADA] Polyline verts=4 closed=True                   (45.388,1.851)-(52.640,10.038) 7.25x8.19 layer=T-BLOCK
  [3D5E] *** RASTERIMAGE                                (45.388,1.851)-(52.640,10.038) 7.25x8.19 layer=T-BLOCK
  [3D61] Hatch                                          (51.083,3.457)-(51.496,3.896) 0.41x0.44 layer=T-BLOCK
  [3D62] Polyline verts=18 closed=False                 (51.083,3.457)-(51.498,3.896) 0.41x0.44 layer=T-BLOCK
  [3D63] TEXT "SITE"                                    (50.626,4.267)-(51.503,4.507) 0.88x0.24 layer=T-BLOCK
  [D9E8] Polyline2d                                     (56.728,13.974)-(58.289,13.974) 1.56x0.00 layer=NOTES
  [D9EC] TEXT "DATE"                                    (56.826,13.827)-(57.176,13.921) 0.35x0.09 layer=NOTES
  [D9ED] TEXT "08/28/26"                                (56.958,14.031)-(57.968,14.238) 1.01x0.21 layer=NOTES
  [D9EE] Polyline2d                                     (52.787,13.974)-(56.347,13.974) 3.56x0.00 layer=NOTES
  [D9F2] TEXT "G.L. SAWHANEY, GA. RLS No. 2547"         (52.922,13.809)-(55.507,13.921) 2.58x0.11 layer=NOTES
  [D9F3] Polyline verts=21 closed=False                 (53.230,13.899)-(53.517,14.352) 0.29x0.45 layer=NOTES
  [D9F4] Polyline verts=15 closed=False                 (53.564,13.958)-(53.765,14.327) 0.20x0.37 layer=NOTES
  [D9F5] Polyline verts=16 closed=False                 (53.841,13.946)-(54.017,14.254) 0.18x0.31 layer=NOTES
  [D9F6] Polyline verts=93 closed=False                 (54.068,13.804)-(55.319,14.160) 1.25x0.36 layer=NOTES
  [DA1C] Polyline verts=4 closed=True                   (53.823,0.183)-(59.423,1.797) 5.60x1.61 layer=1

Notes

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

No notes yet.