I'm trying to get all family from a specific category then I can use GetFamilySymbolIds() to obtain all Ids of family symbols in that family. I just simply think like this:
collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralColumns).OfClass(Family).ToElements()
In that case, I'm trying to get all family in category Structural Columns. But it gives me an empty list.
Here is my code to get ids and names of family in a category:
collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralColumns).OfClass(Family).ToElements() #Get all family in current project
for m in collector:
symbols_ids = list(m.GetFamilySymbolIds())
for i in symbols_ids:
famsymbol = doc.GetElement(i)
symbolName = famsymbol.get_Parameter(BuiltInParameter.SYMBOL_NAME_PARAM).AsString()
print (symbolName + str(i))
Is there a way for me to do this?
Thank you in advance.
P/s: I am using revit 2021
Solved! Go to Solution.
Link copied