C3D-0506 · Find Christmas Ave label + road lines (read-only) [C3D-0507] done
Locate the Christmas Ave text and nearby road/RW polylines to make the label follow the road.
C# payload
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForRead);
foreach(ObjectId eid in ms){ var e=Tx.GetObject(eid,OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity; string s=null; if(e is DBText t) s=t.TextString; else if(e is MText m) s=m.Contents; if(s!=null && s.ToUpper().Contains("CHRISTMAS")){ string extra=""; if(e is DBText t2) extra=" pos="+t2.Position.X.ToString("F2")+","+t2.Position.Y.ToString("F2")+" rot="+(t2.Rotation*180/System.Math.PI).ToString("F1")+" h="+t2.Height.ToString("F2"); if(e is MText m2) extra=" loc="+m2.Location.X.ToString("F2")+","+m2.Location.Y.ToString("F2")+" rot="+(m2.Rotation*180/System.Math.PI).ToString("F1"); Log(e.GetType().Name+" h="+e.Handle+" layer="+e.Layer+extra+" '"+s+"'"); } }
// road/RW lines near
Log("=== ROAD/RW polylines ===");
foreach(ObjectId eid in ms){ var pl=Tx.GetObject(eid,OpenMode.ForRead) as Polyline; if(pl==null) continue; string L=pl.Layer.ToUpper(); if(L.Contains("ROAD")||L.Contains("R/W")||L.Contains("RW")||L.Contains("ROW")||L.Contains("CNTR")||L.Contains("EOP")){ var sb=new System.Text.StringBuilder(pl.Layer+" h="+pl.Handle+" v="+pl.NumberOfVertices+" | "); for(int i=0;i<System.Math.Min(pl.NumberOfVertices,4);i++){var p=pl.GetPoint2dAt(i); sb.Append(p.X.ToString("F1")+","+p.Y.ToString("F1")+" ");} Log(sb.ToString()); } }
Result
Log
DBText h=22440 layer=TEXT-MON pos=2431909.46,1428069.18 rot=0.0 h=5.00 '812 CHRISTMAS AVE - PB 59/147 - 2.452 AC - BEARINGS PER PLAT (MAGNETIC N) - PLACED AT APPROX EPSG:2240 FROM COUNTY ADDRESS POINT, ROTATE/TRANSLATE TO FOUND PINS' === ROAD/RW polylines === SS-V-ROAD-CNTR h=20CC6 v=10 | 2438596.5,1427724.3 2438595.4,1427683.7 2438594.5,1427646.2 2438592.8,1427585.9 SS-V-ROAD-EPVM h=20CC7 v=4 | 2438585.8,1427765.0 2438583.5,1427681.8 2438581.6,1427604.0 2438578.3,1427502.8 SS-V-ROAD-EPVM h=20D40 v=4 | 2438578.3,1427502.8 2438576.1,1427419.6 2438574.1,1427341.8 2438570.8,1427240.6 SS-V-ROAD-EPVM h=20D48 v=3 | 2438570.8,1427240.6 2438568.6,1427157.3 2438567.6,1427128.5 SS-V-ROAD-CNTR h=20D50 v=4 | 2438582.2,1427266.9 2438581.1,1427226.3 2438580.2,1427188.8 2438578.5,1427128.5 SS-V-ROAD-EPVM h=21215 v=10 | 2438608.5,1427724.0 2438607.4,1427683.4 2438606.5,1427645.9 2438604.8,1427585.6 SS-V-ROAD-EPVM h=21216 v=4 | 2438594.1,1427266.6 2438593.1,1427226.0 2438592.2,1427188.5 2438590.5,1427128.2 SS-V-ROAD-CURB h=227BD v=6 | 2433919.6,1429356.3 2433936.8,1429334.3 2433946.5,1429332.1 2433943.8,1429317.5
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.