Tried that, but it looks like the FamilyInstanceFilter only works with loadable families. It makes sense as System families don’t inherit from FamilySymbol:
Regarding if there is another filter for that purpose, I think what is in there is quite nice.
I haven’t tried a logical filter, but it may work. Although I don’t think it would make the code shorter:
Not sure how you were thinking of making the logical filter work as you have to provide quick/slow filters. See sample code below from @Jeremy_Tammik Github.
ElementClassFilter f1
= new ElementClassFilter(
typeof( FamilyInstance ) );
ElementCategoryFilter f2
= new ElementCategoryFilter(
BuiltInCategory.OST_Doors );
ElementCategoryFilter f3
= new ElementCategoryFilter(
BuiltInCategory.OST_Windows );
LogicalOrFilter f4
= new LogicalOrFilter( f2, f3 );
LogicalAndFilter f5
= new LogicalAndFilter( f1, f4 );
My bad, though a combination of those filters would yield something, but have tried it and it is not working. In the end I have to use some combination of methods to retrieve those instances as Jeremy did.
Yes, the last line can be replaced by a quick filter. You can use a parameter filter. That line is checking the value of the WallType element id. The wall type element id is also accessible from a built-in parameter. So, you can set up a parameter filter that checks for equality with the target wall type element id.
eletypes = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsElementType().ToElements()
elety = [eletype for eletype in eletypes if eletype.Name == "Brick230" ]
eles = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls). WhereElementIsNotElementType.ToElements()
neweles = [ele for ele in eles if ele.GetTypeId() == type.Id ]
hi , i’m trying to get all of wall types those are exist in “Wall types” node(Dynamo) alltogether, not only those are exist in my revit project , can you help me about that ?
i’ve already have Python in my dynamo . is there any code that i should copy ?