Hi.
I would like to show all "Label Styles Sample Line" in a datagridview.
I have this, but how I get "LabelStylesSampleLineRoot"?
Autodesk.Civil.DatabaseServices.Styles.LabelStylesSampleLineRoot estilosEtiquetas= civDoc. .................; Autodesk.Civil.DatabaseServices.Styles.LabelStyleCollection collEstilos = estilosEtiquetas.LabelStyles;
Moreover, I want to show a checkbox column in datagrid to show if each style is added in Label Group Sample Line.
Autodesk.Civil.DatabaseServices.SampleLineLabelGroup
Is it one group for each sample line or one group for the sample line group?
How can I get it?
I have been looking for in Sample line group object but I don´t find it.
In the case of Alignment, it has the method GetLabelGroupIds but it is OBSOLETE.
Perhaps, I had to look for in LabelGroup object but then, where is the Label Group sample line?
Thanks in advance.
Solved! Go to Solution.
Solved by joantopo. Go to Solution.
I have seen this method for Sample Line Group objects :
SampleLineGroup.GetAvailableSampleLineLabelGroupIds()
which returns an ObjectIdcollection.
However I don´t understand why Sample Line Group is able to have several Sample Line Label groups.
Autodesk.Civil.DatabaseServices.Styles.LabelStylesSampleLineRoot estilosEtiquetas= civDoc.Styles.LabelStyles.SampleLineLabelStyles; Autodesk.Civil.DatabaseServices.Styles.LabelStyleCollection collEstilos = estilosEtiquetas.LabelStyles; for(int i=0;i<=collEstilos.Count-1;i++) { Autodesk.Civil.DatabaseServices.Styles.LabelStyle estil= trans.GetObject(collEstilos[i],OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.Styles.LabelStyle; string nombre = estil.Name; ObjectId id = estil.ParentLabelStyleId; }