Select which colors are applied to masses?

Hello,

I have modified a Dynamo script I found somewhere in this forum for creating masses from rooms placed in the Revit model. I want to color each mass to correspond with its “FICM Room Category Code”. The script I have is working for that purpose and uses a different color for each room category.

The problem is that Dynamo seems to select the color at random. We have multiple buildings in our model and running the script for each results in different colors being used for the same room code across different buildings.In addition, we would like to be able to generalize the color palette. For example, in the model right now the “Classrooms” are green but the “classroom support” are purple. We would like to make both masses a different shade of the same color.

So, is there a way to preselect which colors are applied to the masses based on the room category code parameter I have set up in the model?

Hope my question makes sense. Attached is an image of the color selection portion of the Dynamo script and the script itself. Any ideas are appreciated, thanks!
RoomtoMass_RoomCatCode_Filtered.dyn (100.5 KB)

1 Like

you should take a look at Dictionaries. This is one way to achieve what you want

3 Likes

Wonderful. I tested this out on a quick example, and it works great. Thanks so much!

1 Like