Hiding/Filtering Model Groups by name

Since Revit doesn’t have this feature yet (baffling), I’m trying to create a filter that will hide model groups in a view based on naming criteria. (I’ve already looked at this topic, but it didn’t say anything after the inquiry.)

I’m trying to do basically the same thing. We’re a mixed-use firm, and some of our sections can get pretty linework-heavy. We’d like to hide the units (each unit is a model group, with the term “unit” in the name) in the section views. I know I can select each model group, right-click, hide element, but there has to be an easier/streamlined way to do this. And then a way to revert back - just like a filter.

So, it would find all the model groups that contain “UNIT” in the name in the view, select them, then hide them.

This seems fairly easy, but I’m EXTREMELY new to Dynamo, so I don’t really know how things work.

Here is what I have currently:

You cannot filter by groups as groups are not a category exposed in the UI, only existing under the hood as they have to contain multiple categories. Groups tend to be very finicky so I avoid them whenever possible. One example data point on the finickyness: check how many toilets you have with a mirrored transform property. For each one in your project you’re showing the flush control on the side that is opposite of the actual model you have specified. Hopefully your specifications state to get either or, otherwise you could be liable for an accessibility code violation in some jurisdictions.

My distaste for them aside, you can select all groups by category, get their name parameter value, use a string.contains node to find which contain unit, and then use a list.filterbyboolmask to ensure you’re only looking at the included set. Then you can use nodes noted in the link and in your images to control what elements are hidden in which views. Watch your lacing in that step. You will need to feed a list of views as well too.

You can all so set the group to a workset and then turn that workset on or off per view. Make sure you know and understand workset as they can come with there own set of problems.

We decided to go with a Workset where those model groups have been assigned to it; then we can just toggle it on and off in those views.

1 Like