I am trying to programmatically change the FamilyType that is mapped to a parameter inside a Family (specifically one that creates Weld Annotations). In this case, the FamilyType(s) in question are only inside the family, so a search for a matching FamilyInstance or FamilySymbol does not apply (nor work, since I tried -- these embedded families do not appear in the browser). These FamilyType(s) also do not appear using GetSubComponentIds -- the parent weld family reports no sub-components. A search for "ParameterType" of that parameter returns "FamilyType", but I don't know what value to apply to that parameter if I can't find an ElementId.
FilteredElementCollector DetailItems = new FilteredElementCollector(doc);
DetailItems.OfClass(typeof(Autodesk.Revit.DB.FamilyInstance));
List<string> Many_Annotations = new List<string>();
foreach (FamilyInstance One_Instance in DetailItems)
{
ICollection<ElementId> Subbies = One_Instance.GetSubComponentIds();//insists that there are NONE with sub-elements?
if (Subbies != null)
{
foreach (ElementId One_Id in Subbies)//apparently a nested component (parameter controlled) is NOT a sub-component?
{
FamilyInstance One_Sub = doc.GetElement(One_Id) as FamilyInstance;
Many_Annotations = MyNamespace.Class.Unique_Strings(One_Sub.Name, Many_Annotations);
}
}
}
The code above always results in an empty List. I understand this may be one of the many items in Revit not yet "exposed".
UPDATE: I have been able to find the required ElementId of the embedded FamilyTypes assigned to instances of a family, but ONLY if that embedded type has been used in one of the Parameters in all FamilyInstances of the Family in question. I have been able to use these to enable radio buttons for those particular choices, but I would like to find "possible" parameter values.