I have a script ready to add view filters to view templates. It only works on a single view template. I would like to change this so that a view filter can be added to multiple view templates at once.
However, the node view.addfilter only accepts one view. Does anyone have an idea for this? maybe there is a node in another custom package?
You can add a list of views to the View.AddFilter. Dynamo will automatically use the Function for all the views in the list.
You do need to think about the levels in the Node. If you provide a list with 5 views and 5 filters, dynamo will add filter 1 to view 1 and filter 2 to view 2.
If you set the level for Views to @2 and the level for Filters to @1, Dynamo will add all the filters from the filter list to all the views.
This will be so helpful! For clarity, what are the code blocks referring to in the ‘which filter’ group? I’ve just tried running with the first showing “ParameterFilterElement” and the second as my filter name, but am getting an error. And not sure where the levels should be adjusted…? I appreciate the help!
I thought I had solved this the other day, but it turns out it’s still not quite working. @Joelmick, is there anything to update now for Revit 2021+ where Filters can be both ‘Enabled’ and ‘Visible’? The goal on my side is to 1) add the filter to all plan view templates and 2) turn off the visibility. Your advice is most welcome!
it look like you used the same code blocks. if i use a custom package, you can see in the script wich version i used. mine works fine in revit 2020, mayby newer version its not working? did you get it ready yet?
Thank you, @Reinier – yes, everything seems to be the same, and it doesn’t give me any errors when I run it (just says ‘Run completed’). I think the difference is to do with 2021 and the added need to select both ‘Enable Filter’ and ‘Visibility’ here:
Could this be an override written into a code block? Replacing the overrides node? Just not sure how to both add and affect the ‘visibility’ side of it.
I need some help, i created the script per @Reinier and @ashley.hastings but when i run it, it is only applying my filter to only 1 view template. I looked under the lists and i see all the view templates and the list for the filters. Here is close up of the lists. The nodes are setup just as above.
@pyXam Thank you that was it. Mine was set to Auto. Just had to change it to Longest and worked great. This Dynamo script is a valuable tool to apply filters to view templates. Thank you to the creator’s and for the assistance in my question.