This is an extension method to get the names of any StyleCollection:
public static List<string> StyleCollectionNames(this StyleCollectionBase scb)
{
var list = new List<string>();
foreach(ObjectId id in scb)
{
var style = (StyleBase)id.Open(OpenMode.ForRead);
list.Add(style.Name);
style.Close();
}
return list;
}
and sample usage:
var stylelist = CivilApplication.ActiveDocument.Styles.ProfileStyles.StyleCollectionNames();
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nThe first name in the list is {0}", stylelist[0]);
var setslist = CivilApplication.ActiveDocument.Styles.LabelSetStyles.ProfileLabelSetStyles.StyleCollectionNames();
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nThe first name in the list is {0}", setslist[0]);