FilterRule.ByRuleType not giving output

I’m trying to make a view template that includes a newly create filter to hide all views that don’t include a text string in an office standard shared parameter called “view folder-BRIC”. I’d like to be able to input the Text String, so I can quickly make a version for each user who joins the project so their views can hide other user views. I’m getting very stumped with the node

ParameterFilterElements.ByRules, but I think it’s actually related to the node FilterRule.ByRuleType not outputting anything. I’m at a loss, everything seems setup to match data types and I can’t find anything on the forums that seem to address this. I’m not really sophisticated enough to tackle it in Python without some painful vibecoding, but it seems like the Dynamo nodes should be function?

I noticed that the Parameter.ParameterByName was included the value (it’s blank in the below image, but the : shows it’s also include the parameter and value), so I double checked in a few ways that it was in fact grabbing a parameter element (that’s all the watch and ID nodes at the bottom).

Thank you for any help!
Trevor

What is the warning on the ParameterFilterElement.ByRules node?

Oh sorry, yes that might be helpful:

ParameterFilterElement.ByRules operation failed.
Object reference not set to an instance of an object.

Hi there. That’s weird why it doesn’t work. Please send a graph image with results previews pinned for each node. It would be much easier to understand what’s gone wrong

See below. I swapped which view is used as the Parameter.ParameterByName just to show the results are the same whether the input is a legend or drafting view, both output the same parameter export (see original post for the one with a legend as the input).

Filter rule.ByRuleType is returning null so any subsequent node won’t have data to use there.

Right click the node, select ‘help’, and see if there is a sample graph you can insert. If not the required inputs should be visible there.

Yes, that null value is why I’m confused and my guess as the source of the issue. The FilterRule.ByRuleType requires inputs of String, value of type Var to check against, and Parameter. I used the autogenerated inputs to create the input nodes. I don’t know what a “Var” type is, but other graphs I’ve seen online worked with a string input so this is what I used, and a string input is what the node requests when using the auto create function.

Is there a sample graph for this node if you scroll down in the help for the node?

I am away from the PC for an extended period so I can’t build out anything as a sample.

I don’t believe so, unless there’s a button I’m missing to show it:

Ok - might want to check the forums then.

@john_pierson any idea is samples exist for this node?

Looking at the code, currently it appears that the FilterRule.ByRuleType is limited to the following filters (see below) as the code does not seem to work for other rule types when I test.

RuleType.Equals
RuleType.NotEquals
RuleType.Greater
RuleType.Less
RuleType.GreaterOrEqual
RuleType.LessOrEqual


I would have to look at the API further, but I think select rule type surfaces a bunch of different rule types for different filters in the Revit API. This would be view filters, parameter filters, filtered element collection filters, all those different kinds.

Not ideal, but I guess I’ll need to find a workaround.