Hide views in other views based on substring

Due to project specifics I make multiple dependent sheets for same story since in reality multiple floors are identical but are requested as separate drawings. Long story short I end up with this:

All views feature all renamed sections since they exist in the same spot due to a duplicate dependency.
I want to hide all section heads in views that don’t belong there:

Like in this example, all views display all sections. I want to element.hide the sections that do not match the substring containing the first number identifier - “02, 03, 04 ect”

I have a list of all views:


and sorting by one identifier is easy with bool mask but how do I group them by identifier and then make them hide all views that aren’t in the group of their identifier for every view?

Personally, I would use filters. but if you want to go the dynamo route:

1 Like

Filters? You can achieve this in revit?

Ah useful for future. But

  1. I am using templates
  2. If I wasn’t I’d still need to assign filters with dynamo since I have over 500 views sometimes.

Very useful, but looks like I didn’t define problem properly. I have more parent views so logic is little bit different and I just spent few h trying to get it right but couldn’t. Here’s how the view list looks like:

I have this list of lists and I want to hide all 04-0X in views 03
So I need to create a list that contains all items sorted in 2 groups - those who contain 03 and those who don’t.
Then the same for 04


Again another instance of the full list devided in 2 groups those who contain 04 and those who don’t and so on.

If it was a singular view group like just 03 that was parent I could use boolMask. But I need a list of all groups and a list of all leftovers from when that group has been taken.

EDIT:
I cycled the list and chopped it in original lenght. I narrowed down th problem down to a very small issue:


I got filter list. I want filter 0 to only check sublist 0 as shown ect. and then use bool mask. I am not sure how to tell the index what to do tho

This should do the trick (Assuming “PN-F5” is the same for all views)

1 Like

Okay this is way better than my method. But it just gave me a false positive here:



Cleaned up more than it should’ve but is nearly perfect. Any idea in which step could it be making this mistake?

not sure without seeing the results in Dynamo.
maybe check the list lengths to spot any discrepancies, might need to set a node to longest lacing


Tried longest lacing on == node but it still acts the same. Also noticed boolMask out+in count is less than highest input for whatever reason.

the total list length is not the only one that matters, the sublists need to match as well
you can count @level to find the sublist lengths

Hi @1bitBoolean ,

You already have a list structure in which you have determined which view should and shouldn’t be hidden, would a list-structure approach like this work?


2023-07-26 Create sublists without each respective sublist in it.dyn (12.3 KB)

Another approach using List.Combinations:

1 Like

Yeah it seams there is an issue with something here


does every “view group” have the same wrongfully hidden views?
In the second screenshot, you seem to be comparing List 0 to List 69
assuming index 69 in getitematindex is in fact “08”, I don’t see anything wrong.
can I see the list that goes into list input of the boolmask? preferably with all nodes showing the same sublist

Ah. I was mistaken comparing those 2.
I found an issue.

Here’s the view in which the INT view is getting wrongfully hidden

Here top is parent views and bottom are views withing views. As seen INT view is completely missing but it still get’s hidden which makes no sense.

Here’s the script. I am lost.
Hide VIEWS in VIEWS.dyn (80.3 KB)

Current logic is:
1)Grab parent views
2)Grab all views within them
3)Hide all views not containing their floor substring eg. 03 or 06

do the INT views wrongfully get hidden at every floor? or just at 03?

Seams INT views on that facade were acting strange even outside dynamo. I replaced them and so far everything seams to be working well. Thanks everybody!

1 Like