Using the FilteredElementCollector pasted below I'm querying the model for all ParameterFilterElements. Instead of returning to me the exact list of ParameterFilterElements seen in the View -> Filters command, I get a list that also includes a number of hidden ParameterFilterElements that have the same names as some of the visible ParameterFilterElements found in View -> Filters but not the same IDs or rules sets. It seems like half of my filters were somehow created twice with the duplicate one being hidden in the model and not containing the same rules.
var filters = new FilteredElementCollector(doc)
.OfClass(typeof(ParameterFilterElement)).ToElements()
.Cast<ParameterFilterElement>()
.ToArray();
To try to work around this I wanted to find a way to programmatically get the list of ParameterFilterElements directly from the View -> Filters command and compare my FilteredElementCollector's results against it to find and remove the extra ones, but I can't find a way to do so.
In general, is there any explanation / remedy for this weirdness?
Thanks!
Solved! Go to Solution.
Solved by Yair.bar. Go to Solution.
Hi!
The best way to help you is to look into your particular model. Is there any chance to see it?
Hi!
Unfortunately I do not know any method to collect filters rather than to use FilteredElementCollector. May be you are able to delete all model elements, views and sheets from the project. And than share it? This would help a lot to understand the problem.
Can't find what you're looking for? Ask the community or share your knowledge.