Help - Filtering out Views with a specific View Name to add value to a Specific Parameter

#1

Hi there!

Just started dabbling into Dynamo and need your help. I want to filter out specific view names and then add a parameter to the category of rooms to that view. Is this even possible?

I want to filter out views that contains “RDS” (Room Data Sheets) and then set a parameter within Rooms to it. But I can’t filter out RDS from View Names to begin with. Am I missing something?

#2

You have null values in the boolean list, replace them with false and it will work.

#3

architectcoding covered it specifically, the issue will be special types of views that cannot hold a View Name, have a look through the list.

Often I collect particular view types first instead (3D, floor plan, section, RCP, elevation) to avoid these rogue views which trigger null values.

#4

@knhan Like this?

#5

Can you elaborate briefly ? How do I do that?

#6

@GavC What views don’t hold a View Name? And how would you filter it out?

#7

The output of String.Contains must be plugged in here :

(Sorry for the messy screenshot)

#8

I did this and got it to work! - But I guess I just realized now that what I’m trying to achieve doesn’t work. But hey! It’s still a step. Thanks for your help.

#9

Knhan try this method, this is the cleanest way to remove the null values, and will result in no warnings when you run the script.

I am not sure what the ‘null’ views are, I assume they relate to something at a system level in Revit (as you can see on top, they have no parameters as they are a null).

You can use the ‘Element Name’ node instead of get parameter to save a few pieces of code too!

Hope that helps :slight_smile: