← Inbox

C3D-0042 · READ-ONLY: find the SEWER EASEMENT annotation in paper space [FIND-SSE-PS] done

Not in model space (0 of 12798). Searches every block table record - all layouts and block definitions - for the 36239.95 / SEWER EASEMENT text and reports its owning record, layer, position and height. No changes.

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

C# payload

// READ-ONLY. The "SEWER EASEMENT / 36239.95 SQ FT / 0.83 ACRES" annotation is NOT in model space
// (scanned all 12798 entities, zero matches). Search EVERY block table record instead - all paper
// space layouts and every block definition - so it is found wherever it actually lives.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);

int scanned = 0, hits = 0;
foreach (ObjectId btrId in bt) {
    var btr = (BlockTableRecord)Tx.GetObject(btrId, OpenMode.ForRead);
    foreach (ObjectId id in btr) {
        Autodesk.AutoCAD.DatabaseServices.DBObject o;
        try { o = Tx.GetObject(id, OpenMode.ForRead); } catch { continue; }
        scanned++;

        string s = null;
        var mt = o as MText;  if (mt != null) s = mt.Contents;
        var dt = o as DBText; if (dt != null) s = dt.TextString;
        if (s == null) continue;

        string u = s.ToUpper();
        if (!(u.Contains("36239") || u.Contains("0.83 ACRE") || u.Contains("SEWER EASEMENT"))) continue;

        hits++;
        var ent = o as Autodesk.AutoCAD.DatabaseServices.Entity;
        Log("");
        Log("HIT [" + o.Handle + "]  type=" + o.GetType().Name + "  in BTR \"" + btr.Name + "\"");
        Log("   layer  " + (ent != null ? ent.Layer : "?"));
        Log("   text   " + s.Replace("\n", " | "));
        if (mt != null) {
            Log(String.Format("   Location  {0:F2},{1:F2}   height={2:F3}  rot={3:F2}",
                mt.Location.X, mt.Location.Y, mt.TextHeight, mt.Rotation * 180.0 / Math.PI));
            Log("   Attachment " + mt.Attachment);
        }
        if (dt != null) {
            Log(String.Format("   Position  {0:F2},{1:F2}   height={2:F3}", dt.Position.X, dt.Position.Y, dt.Height));
        }
    }
}
Log("");
Log("scanned " + scanned + " entities across all block table records, matched " + hits);

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

Log


HIT [2EB48]  type=MText  in BTR "SS_LEGEND"
   layer  BLOCK_LEGEND
   text   IPF IRON PIN FOUND \PIPP IRON PIN PROPOSED\PR/W RIGHT OF WAY\P\PMAG MAGNETIC \PPOB POINT OF BEGINNING\P\PB/L BUILDING LINE \PS.S.E. SANITARY SEWER EASEMENT\PN/F NOW OR FORMERLY \PL.L. LAND LOT\PPP POWER POLE    \P   DROP INLET\P   WATER VALVE\P   SEWER MANHOLE\P   FIRE HYDRANT\P   ELELVATION POINT\P   PROPERTY CORNER\P   FENCE
   Location  -3.21,3.25   height=0.100  rot=0.00
   Attachment TopLeft

scanned 29624 entities across all block table records, matched 1

Notes

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

No notes yet.