Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stacked Wall

2 REPLIES 2
Reply
Message 1 of 3
alvaro_perez
591 Views, 2 Replies

Stacked Wall

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. 

 



 

2 REPLIES 2
Message 2 of 3
jeremytammik
in reply to: alvaro_perez

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

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3
alvaro_perez
in reply to: jeremytammik

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. 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community