Creating Filter Rules - List Manipulation

That’s strange because it works for me.

Have you tried setting your lacing to longest, or setting the value input to level 1?

3 Likes

Oops! @Nick_Boyts is right! Set lacing to longest on your ParameterFilterElement.ByRules node

1 Like

@awilliams something wrong here ?
I think you have to set lacing to longest on FilterRule.ByRuleType node then connect the list output port of List.Create node to the value input port of FilterRule.ByRuleType node. .

2 Likes

Thank you all very much! That was exactly it. I appreciate the help, this forum really is a great resource!

1 Like

cnealy can you post your results. I’ve been fighting with the exact same thing for a week and found this post today. I’ve tired all the different post suggestions with lacing giving me the same results either way. I’m also having a problem that the value is never stored in the filter.

Here is with one workset selected and handful of categories selected.


Results look like this :

With two worksets selected and lacing set to short:


Results look like this:

With two worksets selected and lacing set to long:


Results look like this: Filter Create 2 Workset Selected Lacing Long Results

I’m sure like everything I’ve learned about Dynamo when it doesn’t work, it’s something simple I’m overlooking. I second your appreciation for this forum as an amazing source of nice and bright people willing to help develop other skills.

Of course, see my full script below:

The premise is that it reads any element of “category:Part” in the model (our company uses Parts to make pour drawings for concrete), reads the value of the shared parameter Pour ID that we made, filters it by unique ID, removed the empty ones, and creates a filter where you apply it, turn off the visibility, and all parts that don’t have the requisite Pour ID are hidden.

For example, if you want to only see Base Slab 101 (BS-101), you make a filter called Not BS-101 (where the Pour ID does not contain BS-101) and turn visibility off. My script makes one filter for each unique Pour ID.

Hope this helps!

1 Like

Finally got it sorted out. Lacing was killing me but it was all in the part where you added the "Not " to the name that helped keep the list down to the number of items in the list. I used “” and it worked just fine.

Thanks everyone on this one. Now to move on to applying the filters & create different colors for each one.

1 Like

Check out the OverrideGraphicSettings.ByProperties node in the Revit OOTB dropdown (Revit->Filter->OverrideGraphicSettings). I did something similar with a script I wrote. Combine this with View.SetFilterOverrides and by playing with some of those inputs, you should get to where you need to be.

When you worked on your script did you set it up to batch process the filters you created? I was messing around today with the both of those and was just now figuring out how I can send lists to the View.SetFilterOverrides node. When we start a project we can over 100 electrical panels that we usually manually create the worksets, then filters for. I was working it up to read those panel names from a spreadsheet and take care of all that manual work for us. The part that I haven’t got ironed out yet is how to create different colors for each of the filters. This is what I’m playing with right now.

Create Filter Color Overrides

Duh I see where I was messing up with converting to a string the output of my user selection.

The colors seemed to be random and seems to work ok.

3 Likes

HI @awilliams
do you have any solution if i want to make 2 filter at the same time.
Filter A … rule greater X
Filter B … rule greater Y
(same parameter) …
Thanks

Don’t use Cross Product lacing. Shortest should work.

1 Like

try to sort the filter by the parameter and see what happens?
Surprisingly every time you run the script it replace the one you created before using the same script…
anyone knows why???

Sorry for resurrecting an old thread, but I’m wondering if you’ve had the same problem I’m seeing.
I had a very similar graph that worked fine - until I upgraded Dynamo to 1.3.3.
Now my Parameter.FilterElementByRules node returns only nuls
No other changes. Just upgrading from 1.3.2 to 1.3.3
See this thread:

Hi all,
I am trying to do exactly what you re doing here but I can’t find FilterRule.ByRuleType node !! I have looked in all packages but I really can’t find it !
Would you have any explanations ?

Thank you very much !!!

Hello. Please make a new post when you have a different problem (ex. finding a node by name) instead of reviving an old/solved post. It helps to keep this place organized and for others to find an answer if they have the same problem. The FilterRule.ByRuleType is an OOTB (out of the box) node, meaning it comes standard with Dynamo, not in a package.

Hi @kennyb6,

You can find this node in Dynamo 1.3. I dont know why but it is not with dynamo 2.0…

I have it in my Dynamo 2.0

If it is not in your library, you might have to reinstall Dynamo.

If you are still having problems, please make a new post specific to your problem, and not continuing in this solved thread.

Hi, in Revit 2021, when creating a filter with Dynamo, it seems not very elegant. since it gives a lot of lines filtereing the same parameter and value. See image below.
What am I doing wrong?
Would it be possible to include the AND/OR command improved from Revit 2019?
Thanks in advance.

The Dynamo Script looks like this: