Skip to content

Instantly share code, notes, and snippets.

@Civil3DToolChest
Created March 17, 2014 18:49
Show Gist options
  • Save Civil3DToolChest/9605761 to your computer and use it in GitHub Desktop.
Save Civil3DToolChest/9605761 to your computer and use it in GitHub Desktop.
get label style components object id collection
public ObjectIdCollection getLabelStyleComponentIds(ObjectId labelStyleId, LabelStyleComponentType componentType)
{
ObjectIdCollection componentIds = new ObjectIdCollection();
Document acadDoc = Application.DocumentManager.MdiActiveDocument;
CivilDocument civilDoc = CivilApplication.ActiveDocument;
using (Transaction trans = acadDoc.Database.TransactionManager.StartOpenCloseTransaction())
{
LabelStyle lblstyle = trans.GetObject(labelStyleId, OpenMode.ForRead) as LabelStyle;
componentIds = lblstyle.GetComponents(componentType);
trans.Commit();
}
return componentIds;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment