Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Can I get the actual elements filtered by ParameterFilterElement, based on its rule?
Solved! Go to Solution.
Hi,
Can I get the actual elements filtered by ParameterFilterElement, based on its rule?
Solved! Go to Solution.
It is dependant on filter order and the View.GetFilters returns filters in an order not related to how they are applied in the visibility graphics dialogue.
So unless you've created the filter yourself elsewhere the answer is no.
Requested that View.GetFilters return rules in correct order here.
Hi RPTHOMAS108,
I can create the filter myself. I mean, I want to know what elements are selected by its rule, NOT what elements are affected by its rule when applied to views. For example, the filter's rule is to select some wall whose name contains 'structural'. Can I get the actual collection of structural wall by some API function, or I have to calculate myself? Thanks.
You can either use ElementParameterFilter with each rule but it's a slow filter meaning element has to be expanded in memory. So you should use on the results of a category or class filter for wall.
Personally I would use a category filter and then search the results with LINQ to match names with 'structural' if that is all you are looking to do, rather than use a parameter filter. Internally these filters are probably doing the same as that anyway.
Each FilterRule also has an .ElementPasses method so this can also be used within a LINQ expression on the results of a category or class filter.