C3D-0233 · 260612 Springdale: read inside SS_BLOCK_11X17 done
READ-ONLY. Every entity in the block definition with extents, attribute tags and text, to identify the title-block cluster before relocating it.
C# payload
// READ-ONLY: everything inside the SS_BLOCK_11X17 definition, with each entity's extents,
// so the title-block cluster can be identified by position before anything is moved.
var bt = (BlockTable)Tx.GetObject(Db.BlockTableId, OpenMode.ForRead);
if (!bt.Has("SS_BLOCK_11X17")) { Log("SS_BLOCK_11X17 not found"); return; }
var btr = (BlockTableRecord)Tx.GetObject(bt["SS_BLOCK_11X17"], OpenMode.ForRead);
Log("=== SS_BLOCK_11X17 contents ===");
Log("origin/base point: " + btr.Origin.ToString());
double gxmin=1e30, gymin=1e30, gxmax=-1e30, gymax=-1e30;
int n = 0;
foreach (ObjectId id in btr) {
Autodesk.AutoCAD.DatabaseServices.DBObject o;
try { o = Tx.GetObject(id, OpenMode.ForRead); } catch { continue; }
var ent = o as Autodesk.AutoCAD.DatabaseServices.Entity;
if (ent == null) continue;
n++;
double xmin=0, ymin=0, xmax=0, ymax=0;
bool haveExt = false;
try {
var e = ent.GeometricExtents;
xmin=e.MinPoint.X; ymin=e.MinPoint.Y; xmax=e.MaxPoint.X; ymax=e.MaxPoint.Y;
haveExt = true;
if (xmin<gxmin) gxmin=xmin; if (ymin<gymin) gymin=ymin;
if (xmax>gxmax) gxmax=xmax; if (ymax>gymax) gymax=ymax;
} catch { }
string extra = "";
var ad = ent as AttributeDefinition;
if (ad != null) extra = string.Format(" TAG={0} prompt=\"{1}\" default=\"{2}\" pos=({3:F3},{4:F3}) h={5:F3}",
ad.Tag, ad.Prompt, ad.TextString, ad.Position.X, ad.Position.Y, ad.Height);
var mt = ent as MText;
if (mt != null) extra = string.Format(" \"{0}\" at ({1:F3},{2:F3}) h={3:F3}",
mt.Contents.Replace("\n", " ").Substring(0, Math.Min(45, mt.Contents.Length)), mt.Location.X, mt.Location.Y, mt.TextHeight);
var dt = ent as DBText;
if (dt != null) extra = string.Format(" \"{0}\" at ({1:F3},{2:F3}) h={3:F3}",
dt.TextString, dt.Position.X, dt.Position.Y, dt.Height);
var ln = ent as Line;
if (ln != null) extra = string.Format(" ({0:F3},{1:F3})->({2:F3},{3:F3})",
ln.StartPoint.X, ln.StartPoint.Y, ln.EndPoint.X, ln.EndPoint.Y);
Log(string.Format("[{0}] {1,-20} layer={2,-18} ext=({3:F3},{4:F3})-({5:F3},{6:F3}){7}",
ent.Handle, ent.GetType().Name, ent.Layer,
haveExt?xmin:0, haveExt?ymin:0, haveExt?xmax:0, haveExt?ymax:0, extra));
}
Log("");
Log(string.Format("entities={0} BLOCK EXTENTS=({1:F3},{2:F3})-({3:F3},{4:F3}) size {5:F3} x {6:F3}",
n, gxmin, gymin, gxmax, gymax, gxmax-gxmin, gymax-gymin));
Result
Log
=== SS_BLOCK_11X17 contents === origin/base point: (0,0,0) [23391] Viewport layer=BLOCK_TB2 ext=(-21.461,0.043)-(-0.043,16.434) [23394] Line layer=BLOCK_TB2 ext=(-0.043,0.043)-(-0.043,1.821) (-0.043,0.043)->(-0.043,1.821) [23395] Line layer=BLOCK_TB2 ext=(-21.461,16.434)-(-0.043,16.434) (-21.461,16.434)->(-0.043,16.434) [23396] Line layer=BLOCK_TB2 ext=(-21.509,16.477)-(0.000,16.477) (-21.509,16.477)->(0.000,16.477) [23397] MText layer=BLOCK_TB2 ext=(-15.043,2.175)-(-11.460,2.545) "ALL MATTERS OF TITLE ARE EXCEPTED. THIS PLAT " at (-15.043,2.545) h=0.085 [23398] Line layer=BLOCK_TB2 ext=(-15.156,2.051)-(-15.156,2.710) (-15.156,2.710)->(-15.156,2.051) [23399] Line layer=BLOCK_TB2 ext=(-21.458,1.780)-(-13.714,1.781) (-21.458,1.781)->(-13.714,1.780) [2339A] Line layer=BLOCK_TB2 ext=(-21.458,1.510)-(-13.714,1.511) (-21.458,1.511)->(-13.714,1.510) [2339B] Line layer=BLOCK_TB2 ext=(-21.458,1.240)-(-13.714,1.242) (-21.458,1.242)->(-13.714,1.240) [2339C] Line layer=BLOCK_TB2 ext=(-21.458,0.970)-(-13.714,0.972) (-21.458,0.972)->(-13.714,0.970) [2339D] Line layer=BLOCK_TB2 ext=(-21.458,2.051)-(-13.840,2.051) (-21.458,2.051)->(-13.840,2.051) [2339E] DBText layer=BLOCK_TB2 ext=(-16.355,1.308)-(-14.874,1.425) "SCALE: GRAPHIC" at (-16.355,1.308) h=0.117 [2339F] Line layer=BLOCK_TB2 ext=(-18.919,0.971)-(-18.919,1.781) (-18.919,1.781)->(-18.919,0.971) [233A0] Line layer=BLOCK_TB2 ext=(-13.840,2.051)-(-11.301,2.051) (-13.840,2.051)->(-11.301,2.051) [233A1] Line layer=BLOCK_TB2 ext=(-21.458,2.710)-(-11.303,2.710) (-21.458,2.710)->(-11.303,2.710) [233A2] DBText layer=BLOCK_TB2 ext=(-21.417,2.582)-(-20.508,2.659) "PREPARED FOR:" at (-21.417,2.582) h=0.076 [233A3] Line layer=BLOCK_TB2 ext=(-16.809,0.971)-(-16.808,1.781) (-16.808,1.781)->(-16.809,0.971) [233E1] Line layer=BLOCK_TB2 ext=(-15.368,2.898)-(-15.368,2.931) (-15.368,2.931)->(-15.368,2.898) [233E3] Line layer=BLOCK_TB2 ext=(-21.458,0.043)-(-21.458,2.710) (-21.458,2.710)->(-21.458,0.043) [233E4] Line layer=BLOCK_TB2 ext=(-13.714,0.043)-(-13.714,2.051) (-13.714,2.051)->(-13.714,0.043) [233E5] Line layer=BLOCK_TB2 ext=(-21.458,0.043)-(-0.041,0.043) (-21.458,0.043)->(-0.041,0.043) [233E6] Line layer=BLOCK_TB2 ext=(-21.458,2.710)-(-11.303,2.710) (-11.303,2.710)->(-21.458,2.710) [233E7] Line layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,6.883) (0.000,0.000)->(0.000,6.883) [233E8] Line layer=BLOCK_TB2 ext=(-0.043,0.043)-(-0.043,16.434) (-0.043,0.043)->(-0.043,16.434) [233E9] Line layer=BLOCK_TB2 ext=(-21.509,0.000)-(0.000,0.000) (-21.509,0.000)->(0.000,0.000) [233EA] Line layer=BLOCK_TB2 ext=(-21.509,0.000)-(-21.509,16.477) (-21.509,16.477)->(-21.509,0.000) [233EB] DBText layer=BLOCK_TB2 ext=(-19.767,0.598)-(-15.386,0.835) "SAWHNEY & ASSOCIATES" at (-19.801,0.598) h=0.238 [233EC] DBText layer=BLOCK_TB2 ext=(-19.372,0.378)-(-17.778,0.483) "523 HASTINGS WAY" at (-19.372,0.378) h=0.106 [233ED] DBText layer=BLOCK_TB2 ext=(-17.610,0.365)-(-15.781,0.471) "JONESBORO GA 30238" at (-17.610,0.365) h=0.106 [233EE] DBText layer=BLOCK_TB2 ext=(-18.479,0.208)-(-17.132,0.340) "PH.# (678)478-6857" at (-18.486,0.235) h=0.081 [233EF] Line layer=BLOCK_TB2 ext=(-14.365,0.043)-(-14.364,0.971) (-14.364,0.971)->(-14.365,0.043) [233F0] Line layer=BLOCK_TB2 ext=(-0.000,6.883)-(-0.000,13.765) (-0.000,6.883)->(-0.000,13.765) [233F1] Line layer=BLOCK_TB2 ext=(-0.000,13.765)-(0.000,16.477) (-0.000,13.765)->(0.000,16.477) [233F3] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "JOB NO.: 251002" at (-16.357,1.064) h=0.117 [233F4] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "SITE_ADDRESS" at (-21.395,1.870) h=0.117 [233F5] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "REF DB xxx Page xxx" at (-21.392,1.051) h=0.117 [233F6] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "LAND LOT: ###" at (-18.883,1.601) h=0.117 [233F7] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "DISTRICT: #TH" at (-18.880,1.335) h=0.117 [233F8] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "COUNTY: CLAYCO" at (-18.887,1.051) h=0.117 [233F9] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "DATE: 10/16/25" at (-16.333,1.590) h=0.117 [233FA] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "SUBDIVISION_NAME LOT ##" at (-14.136,2.822) h=0.117 [233FB] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "PREP_FOR" at (-21.346,2.237) h=0.150 [233FC] AttributeDefinition layer=BLOCK_TB2 ext=(0.000,0.000)-(0.000,0.000) "BOUNDARY SURVEY" at (-21.444,2.821) h=0.200 [233FD] Line layer=BLOCK_TB2 ext=(-21.461,0.043)-(-21.461,16.434) (-21.461,0.043)->(-21.461,16.434) [2F07C] Line layer=BLOCK_TB2 ext=(-11.301,0.043)-(-11.301,2.051) (-11.301,2.051)->(-11.301,0.043) [2F07D] Line layer=BLOCK_TB2 ext=(-11.301,0.703)-(-11.301,2.710) (-11.301,2.710)->(-11.301,0.703) entities=46 BLOCK EXTENTS=(-21.509,0.000)-(0.000,16.477) size 21.509 x 16.477
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.