Room color by area comparison

Hello everyone. Could someone be kind enough to help me?
Please note that I don’t know anything about Dynamo.
I created this simple schedule in my Revit project to compare the current area of ​​the rooms with the required area. With conditional formatting, I got the areas that need to be improved in red. This is nice but not effective.
Would it be possible to have a color scheme with Dynamo so this visual information can be seen directly on the floor plan?
For example, when compared to the required area, the rooms with the same area have a green color assigned, the rooms with the largest area have yellow, and the rooms with the smallest area have red. If the required area is empty, do nothing.
This would be very helpful to know directly on the floor plan which rooms need to be adjusted to obtain the correct area.

Sorry if this is a dumb question, but could it be linked to the schedule columns? This way when I add more rooms, Dynamo would automatically catch up.

Definitely possible. It’s just a conditional (a few nested conditionals actually) and an override. I’d recommend starting with the Dynamo Primer to get a basic understanding of Dynamo and how node logic works. Then you can search the forum for similar topics involving filtering elements, getting parameter values, and setting view overrides.

The limitation with Dynamo is that a graph needs to be run in order to execute any of your automation. It wouldn’t be able to “automatically update”, but a single click in Dynamo Player could ensure that all the data is up to date.

heres a simple graph, you could leave it running in the background on “Automatic” and it would update continuously

you still need to setup the color scheme in Revit though, I dont think you can affect the color scheme with out of the box nodes

This is never recommended for production use. Automatic is fine for writing and troubleshooting your graph but you should always use Manual for production model changes if you aren’t using Player (the better option). There’s just too much going on that could cause problems for Automatic mode in a production use case.

2 Likes

For that type of behavior I would recommend using event subscription - much safer.

Maybe a tool like property wizard is worth the use exploring as it does this without the need for code:

Hi Adam,
Unfortunately, it didn’t work for me.

Yes I hear Property Wizard is excellent :slight_smile:

1 Like

I used an area plan instead of rooms, so change the category from Areas to Rooms

looks like you have already created the parameter Required Area so you just need to create the parameter scheme and change the color scheme to that parameter and add a value for red

and yes not a great idea to leave dynamo constantly running in background, but I’d say its ok to leaving running in background whilst working specifically on rooms/areas, just close dynamo or set to manual when you have finished

I changed to rooms and now I am getting the list. It is just this last part I don’t understand: ‘’… you just need to create the parameter scheme and change the color scheme to that parameter and add a value for red’’

  1. How and where must I create the parameter scheme?
  2. How do I change the color scheme to this parameter?
  3. How do I add a value for red?

I think the idea is that using a Color Scheme for the view would make this pretty easy. The only issue with a color scheme is that it can’t use a calculated value from a schedule. So you just need to setup a parameter the Dynamo writes the calculated difference to. That parameter would then control the color scheme based on value.

I think I understand the idea, but how do I set up this parameter?

If you don’t know how Color Schemes work you should look into them. That would all be a manual setup in the project, including the parameter. The Dynamo script would just be to fill in the parameter with the calculated difference. It’s the same as your calculated field in the schedule, it’s just a “manual” process. You can even use the new parameter in your schedule to do a quick check that the live calculated value matches the project parameter in the Color Scheme.

1 Like

Sorry Nick, I was able to create the Color Scheme. I don’t understand about the parameters.

  1. How and where must I create the parameter scheme?
    a) Is it a Project Parameter?
    b) With which Data Type?
    c) In which Category? Rooms?

  2. How do I add a value for red?
    a) Is it a Project Parameter?
    b) With which Data Type? There is no Color Data Type in the drop-down list.
    c) In which Category? Rooms?

Color Schemes are like dynamic view filters for parameters with multiple values. If you want to color rooms based on the difference in actual and required area then you need a parameter that contains that value (not a calculated field). If you don’t have a parameter like that yet (which I don’t think you do) then you need to create a project parameter for rooms with the number type. Dynamo would just calculate the difference the same as your calculated field and write that value to the new parameter. You would then create a Color Scheme that reads that parameter and setup the different conditions (>, <, and = 0) with their respective color overrides.

Ok, so this will be my red parameter.

What about my scheme parameter?
Which Data Type and Category?

Like this?

The name is irrelevant. I think scheme was given as a generic example and red was given as one of your conditions. You just need one parameter driving the scheme. Then you need to setup the “filter” part via the range of values you want to identify and how you want to show them - you mentioned red, yellow, and green for undersized, oversized, and matching sizes respectively.


In this example, Area would be the project parameter that you’re writing to.

Ok, one last try before I gave up.
First : Revit doesn’t let me put 0 on the last line as you did:

Second : It’s still not working :

I think (pretty sure actually) the statement in your Code Block is wrong.
Try this :point_down:.

ok, sorry for not being more explicit earlier, a combination of being pushed for time and wanting to give you a chance to explore it for your self, heres a bit more detail

you need to create a parameter lets call it my_scheme_text_string

I’ve set the category as an area, because I prefer area schedules, but of course you can adapt for rooms

next edit the the color scheme so that you are coloring in by the parameter value of my_scheme_text_string

create some presets, red , green and blue , none of them are in use yet

now if you set the parameter my_scheme_text_string to red then the color scheme will change the fill

now you can use dynamo to set the value of the parameter my_scheme_text_string to whatever you want