Hi - I am trying to extract all the family names from the project, but I keep getting the AttributeError: Name.
Here’s the code:
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
from Autodesk.Revit.DB import BuiltInParameter
doc = __revit__.ActiveUIDocument.Document
family_symbols = FilteredElementCollector(doc).OfClass(FamilySymbol).OfCategory(BuiltInCategory.OST_StructuralFraming).ToElements()
for family_symbol in family_symbols:
print( family_symbol.Name)
This give me the AttributeError: Name. However, when I run the dir(family_symbol), name property shows up in the list.
At the same time, running this exact code inside RPS works and gives the correct result.
Thank you in advace!