ParameterFilterElement

ParameterFilterElement

kuang_hf
Enthusiast Enthusiast
1,186 Views
3 Replies
Message 1 of 4

ParameterFilterElement

kuang_hf
Enthusiast
Enthusiast

Hi,

   Can I get the actual elements filtered by ParameterFilterElement, based on its rule?

0 Likes
Accepted solutions (1)
1,187 Views
3 Replies
Replies (3)
Message 2 of 4

RPTHOMAS108
Mentor
Mentor

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.

0 Likes
Message 3 of 4

kuang_hf
Enthusiast
Enthusiast

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.

0 Likes
Message 4 of 4

RPTHOMAS108
Mentor
Mentor
Accepted solution

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.