Hello everyone,
I am a noob using API revit, I am having troubles.
I am trying collect both usual wall and stacked wall in just one collector.
If in my doc I have a stacked wall (i.e. 3 walls make one stacked wall) and I collect like
FilteredElementCollector collector = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls); FilteredElementCollector wallCollector = collector.OfCategory(BuiltInCategory.OST_Walls);
I get "wallCollector" formed by 3 elements, one per each stacked wall member. Each is handled in a independent way.
On the other hand, if I collect like
FilteredElementCollector collector = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StackedWalls); FilteredElementCollector wallCollector = collector.OfCategory(BuiltInCategory.OST_StackedWalls);
I only collect stackedWalls.
My question is: Could I get a new collector formed by stackedWalls ( not separated) and usual walls?
This way, I could handle stackedWall like one and usual wall.
You can use a Boolean operator filter to unite the two results, represented by ElementLogicalFilter, a filter used to logically combine two or more filters:
https://apidocs.co/apps/revit/2019/3b8d6b55-0cab-1810-1188-840800e5eaa2.htm
But if I unite the both filter I will get the same that I'd get filtering by class.
FilteredElementCollector collector = new FilteredElementCollector(doc); ICollection<Element> wallCollector = collector.OfClass(typeof(Wall)).ToElements();
I'd have 3 stacked wall member separated and, moreover, 1 stacked wall.