Create a collection that filters by Main Model and Primary Design Option

Create a collection that filters by Main Model and Primary Design Option

Anonymous
Not applicable
1,118 Views
4 Replies
Message 1 of 5

Create a collection that filters by Main Model and Primary Design Option

Anonymous
Not applicable

I would like to know if someone can help me create a collection of elements filtered by Design Option. I would like the collection to contain Main and all primary options.

I can't get my head around this. I can get a Design Option set, but only the primary ones and I can't fin d way to include the Main model.

0 Likes
Accepted solutions (1)
1,119 Views
4 Replies
Replies (4)
Message 2 of 5

matthew_taylor
Advisor
Advisor

If you're using a FilteredElementCollector, you should be able to use coll1.UnionWith(coll2) to unite separate collectors.


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes
Message 3 of 5

BobbyC.Jones
Advocate
Advocate

Are you having trouble combining the collectors, or creating a collector that gets elements in the main model?

--
Bobby C. Jones
0 Likes
Message 4 of 5

Anonymous
Not applicable

My problem is a bit of both I think. I can think I know how to combining filters, but I can not figure out a way to get only primary design options and the main model. I can only create a filter on design option sets and I can not find a way to get Main Model elements.

0 Likes
Message 5 of 5

BobbyC.Jones
Advocate
Advocate
Accepted solution

Well, if you know how to find all of the primary design options, you can create an ElementDesignOptionFilter for each and another one for the main model by passing ElementId.InvalidElementId, then combine them all into a logical filter that you can pass to your collector.

 

--
Bobby C. Jones
0 Likes