Revit Dynamo View Filter Creation Help

Hello,

I am rather new to the whole world of Dynamo, I have searched the forums and google high and wide and found a dynamo script only that appears to work for my purpose.

My end goal with this script is for it to create filters automatically once the section view is dropped onto a sheet. Once the section is dropped onto a sheet the Sheet Number parameter is automatically filled in so I felt this was a good parameter to use for this. the type of filter i want created would be applied to section category and the sheet number would be used in a not equal style format.

In my attempts to create the same script Im running into errors with the ParameterFilterelement.ByRules node.

I have tried the same script with some restructuring to utilize the Archi-Lab ViewFilter.CreateFilter node as well and cant seem to get that to work.

This is my current warning from the ParameterFilterelement.ByRules node, Warning: ParameterFilterElement.ByRules operation failed.
One of the given rules refers to a parameter that does not apply to this filter’s categories.
Parameter name: elementFilter

I have read several posts that this node may be broken however I cant get any workaround to actually function.

I am currently running Revit MEP 2020.

Thanks

Hi @rmcdonaldssmi,

I have ran into the same problem, but I don’t know if the solution is the same.

My problem was that when I have a section view which is placed onto a sheet, it has the Parameter “Sheet Number” twice. (I dont know why).

One of the 2 parameters can be used for filters and I couldn’t find out which.

What I did was brute force my way through Python.

SheetNumberFilters.dyn (61.4 KB)

This might work for you, the steps are easy:

  1. Get all Section Views

  2. Get both “Sheet Number” parameters from each Section view

  3. Make sure there are 2 parameters per section view (Sometimes it has 1).
    000124

  4. Create a filter Name per Section View
    000125

  5. Create a List of Filter Rules, So a list of lists (A filter rule for each one of the 2 Sheet number Parameters)
    000126

  6. Use Python to do a few things:
    6.1 Check if there is already a filter with the given filter name (if so, get that one, otherwise create a blank filter)
    6.2 Try each filter rule with the Filter, you can do this with python. Since one of the two will fail (Sometimes the first, sometimes the second) it will always find the right one.
    6.3 return the created filters and a Log file

@Joelmick
Thank you for the very in depth reply.

I was not able to get your version of the script to work last night. I ran into a couple of errors mainly that the FilterRule node errored with receiving a string instead of a parameter. I may have connected it incorrectly I am not sure as I cant see the interconnecting lines from screenshot to screenshot. Also I am very new with python scripts but seeing as I couldn’t get correct data to the python node that’s another story.

I was able to create view filters with a slight change to my original post by changing the parameter to Sheet Name in lieu of the Sheet Number parameter. The only issue I ran into with this is that it applied every single sheet name tied to a section view in each filter.

New user, therefor a second post for image number 2

Solved my own issue with more research. List.Chop Node

More often that not in our drawings the section views are all specific to each drawing. therefor this is creating my section view filters automatically as the views are dropped onto sheets.

For those that are interested. I have attached the completed file.
Section View Filter.dyn (146.6 KB)

1 Like