ParameterFilterElement.ByRules not getting FilterRule.ByRuleType

Hi everyone,

I’m attempting to set a filter based on what I believe are basic rule settings. However, it’s not functioning in a configuration that I believe should be problem-free.

It may be something straightforward, but I would appreciate assistance with this.

The FilterRuleType always seem a bit troublesome - it feels like it won’t accept the inputs even though they are correct until you close and open the script again. Tricky one.

However - I think it will work better if you filter on “Family Name” instead of “Family” - since “Family Name” is something you actually can filter on manually in Revit.

2 Likes

Thanks for your help,

I tried both ways you told me (Closing and using “Family name”), but for some reason, the “Family” parameter doesn’t retrieve anything, and closing and re-opening didn’t work either.

I made some modifications aiming for a better result, but still… I’m not getting any results.

I think the suggestion was to use the Family Name parameter and not the Family parameter. Family returns an element rather than a string and is not a valid parameter to filter by. If you try to make this filter in Revit you’ll see that Family isn’t available in the selection.

1 Like

image
Okay, I had to take a different approach, but the issue is resolved.

As you can see in the screenshot, the element was not retrieving the Family Name. Therefore, I had to use another node to fetch the Family name and then get the script to work.

Thank you all for your help.

1 Like

Correct. Family Name is actually a type parameter and therefore must be retrieved from the Family or Family Type.

1 Like