I’ve encountered an oddity that I’m hoping someone can shed some light on for me.
Using Python in Dynamo, I’m trying to loop through multiple documents, in this case, linked models, to get all of the nested light fixtures. I’m using the same code that I’ve been using for years, but when I change the built-in category to “BuiltInCategory.OST_LightingFixtures” I get Family Types instead of Family Instances. In the same script, I’m doing the exact same thing with Columns and Structural Columns…so what is the difference? Is there something special about lighting fixture families that I’m not aware of? I’ve been scouring the internet for an answer.
This works:
LinkDoc = UnwrapElement(IN[0])
colList = []
for d in LinkDoc:
colColl = FilteredElementCollector(d)
colColl.OfCategory(BuiltInCategory.OST_Columns)
colColl.WhereElementIsNotElementType()
sColColl = FilteredElementCollector(d)
sColColl.OfCategory(BuiltInCategory.OST_StructuralColumns)
sColColl.WhereElementIsNotElementType()
for c in colColl:
colList.append(c)
for s in sColColl:
colList.append(s)
OUT = colList
This does not:
LinkDoc = UnwrapElement(IN[0])
lightFixtList = []
bic = BuiltInCategory.OST_LightingFixtures
for d in LinkDoc:
lightColl = FilteredElementCollector(d)
lightColl.OfCategory(bic).WhereElementIsNotElementType()
for l in lightColl:
lightFixtList.append(l)
OUT = lightFixtList