C3DO-0748 · 261101 legend text line positions (read-only) [C3D-LEGPROBE] error
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(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
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.