C3DO-0749 · 261101 legend text line positions (read-only) [C3D-LEGPROBE] done
Read-only: the legend MText's line positions and the size of the point symbol blocks.
C# payload
var tbl=(BlockTable)Tx.GetObject(Db.BlockTableId,OpenMode.ForRead);
var lb=(BlockTableRecord)Tx.GetObject(tbl["SS_LEGEND"],OpenMode.ForRead);
foreach(ObjectId id in lb){ var m=Tx.GetObject(id,OpenMode.ForRead) as MText; if(m==null) continue;
Log("MText ht="+m.TextHeight+" spacingFactor="+m.LineSpaceDistance+" style="+m.LineSpacingStyle+" factor="+m.LineSpacingFactor+" actualH="+m.ActualHeight+" loc="+m.Location);
var c=new DBObjectCollection(); m.Explode(c); foreach(Autodesk.AutoCAD.DatabaseServices.DBObject o in c){ var t=o as DBText; if(t!=null) Log(" frag y="+t.Position.Y.ToString("F4")+" x="+t.Position.X.ToString("F4")+" '"+t.TextString+"'"); o.Dispose(); } }
foreach(var bn in new[]{"Utility Pole","Gas Valve","Drill Hole","Iron Pin","_Wipeout_Circle","Catch Basin","Water Valve"}){ if(!tbl.Has(bn)){ Log("no block "+bn); continue; } var b=(BlockTableRecord)Tx.GetObject(tbl[bn],OpenMode.ForRead); var ext=new Extents3d(); bool any=false; foreach(ObjectId id in b){ var e=(Autodesk.AutoCAD.DatabaseServices.Entity)Tx.GetObject(id,OpenMode.ForRead); try{ ext.AddExtents(e.GeometricExtents); any=true; }catch{} } Log("block "+bn+(any?" ext "+ext.MinPoint+"-"+ext.MaxPoint:" empty")); }
Result
Log
MText ht=0.0999911611032738 spacingFactor=0.1586891719671608 style=AtLeast factor=0.9522191974744367 actualH=3.010803972615196 loc=(-3.211368532712571,3.2510462603564783,0) frag y=3.1511 x=-3.2209 'IPF IRON PIN FOUND' frag y=2.9924 x=-3.2209 'IPP IRON PIN PROPOSED' frag y=2.8146 x=-3.2209 'R/W RIGHT OF WAY' frag y=2.6569 x=-3.2209 'RWM RIGHT OF WAY MARKER' frag y=2.4982 x=-3.2209 'MAG MAGNETIC' frag y=2.3395 x=-3.2209 'POB POINT OF BEGINNING' frag y=2.1808 x=-3.2209 'POC POINT OF COMMENCEMENT' frag y=2.0030 x=-3.2209 'B/L BUILDING LINE' frag y=1.8453 x=-3.2209 'D.E. DRAINAGE EASEMENT' frag y=1.6675 x=-3.2209 'N/F NOW OR FORMERLY' frag y=1.5098 x=-3.2209 'L.L. LAND LOT' frag y=1.3511 x=-3.2209 'PP POWER POLE' frag y=1.1924 x=-3.2114 ' DROP INLET' frag y=1.0337 x=-3.2114 ' WATER VALVE' frag y=0.8750 x=-3.2114 ' SEWER MANHOLE' frag y=0.7163 x=-3.2114 ' FIRE HYDRANT' frag y=0.5576 x=-3.2114 ' ELEVATION POINT' frag y=0.3989 x=-3.2114 ' PROPERTY CORNER' frag y=0.2402 x=-3.2114 ' FENCE' block Utility Pole ext (-0.09375000000004548,-0.03750000000002274,0)-(0.09374999999993179,0.03750000000002274,0) block Gas Valve ext (-0.07973868918721294,-0.06163397996162834,0)-(0.07973868918721472,0.1532071200170545,0) block Drill Hole ext (-0.05,-0.05,0)-(0.05,0.05,0) block Iron Pin ext (-0.05,-0.05,0)-(0.05,0.05,0) block _Wipeout_Circle ext (-0.4990133642141332,-0.496057350657237,0)-(0.4990133642141359,0.4999999999999997,0) block Catch Basin ext (-0.05000000000006821,-0.0500000000001819,0)-(0.049999999999954525,0.04999999999984084,0) block Water Valve ext (-0.07973868918721472,-0.06163397996162945,0)-(0.07973868918721294,0.1532071200170534,0)
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.