C3D-0558 · Read contour label styles 260711 R2 (read-only) error
Which contour label styles the surface contour labels use, and their text component contents (precision).
C# payload
var ms=(BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db),OpenMode.ForRead);
var styles=new System.Collections.Generic.Dictionary<ObjectId,int>();
foreach(ObjectId e in ms){ if(e.IsErased) continue; var o=Tx.GetObject(e,OpenMode.ForRead);
if(o is Autodesk.Civil.DatabaseServices.SurfaceContourLabelGroup g){ var sid=g.StyleId; if(!styles.ContainsKey(sid)) styles[sid]=0; styles[sid]++; } }
foreach(var kv in styles){ var st=(Autodesk.Civil.DatabaseServices.Styles.LabelStyle)Tx.GetObject(kv.Key,OpenMode.ForRead); Log("STYLE '"+st.Name+"' used by "+kv.Value+" label groups");
foreach(ObjectId cid in st.GetComponents(Autodesk.Civil.DatabaseServices.Styles.LabelStyleComponentType.Text)){ var c=(Autodesk.Civil.DatabaseServices.Styles.LabelStyleTextComponent)Tx.GetObject(cid,OpenMode.ForRead); Log(" text comp '"+c.Name+"' contents="+c.Text.Contents.Value); } }
// all surface contour label styles in the drawing
var cs=CivilDoc.Styles.LabelStyles.SurfaceLabelStyles.ContourLabelStyles;
foreach(ObjectId sid in cs){ var st=(Autodesk.Civil.DatabaseServices.Styles.LabelStyle)Tx.GetObject(sid,OpenMode.ForRead); Log("available contour label style: "+st.Name); }
Result
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.