Family |
Gets the sub component ElementIds of the current family instance.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)


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);
}
}
