FamilyInstance.GetSubComponentIds
Method
Description:
Gets the sub component ElementIds of the current family instance.
Gets the sub component ElementIds of the current family instance.
Examples
public void GetSubAndSuperComponents(FamilyInstance familyInstance)
{
ICollection<ElementId> subElemSet = familyInstance.GetSubComponentIds();
if (subElemSet != null)
{
string subElems = "";
foreach (Autodesk.Revit.DB.ElementId ee in subElemSet)
{
FamilyInstance f = familyInstance.Document.GetElement(ee) as FamilyInstance;
subElems = subElems + f.Name + "\n";
}
TaskDialog.Show("Revit","Subcomponent count = " + subElemSet.Count + "\n" + subElems);
}
FamilyInstance super = familyInstance.SuperComponent as FamilyInstance;
if (super != null)
{
TaskDialog.Show("Revit","SUPER component: " + super.Name);
}
}