Coloring rooms based on the excel file values


With the reference to the previous post (Shading rooms using CSV file values), I am trying to color the rooms based on the values taken from the excel file. I have taken rooms data from the Revit model and imported data from the excel file. But I don’t know how to set the threshold to color the rooms. For example; Room value > 20 have the color “Red”. I am attaching the file below.

Home.dyn (7.3 KB)

Excel data: Columns are Room Name| Room Number | Room Value



Maybe something like:

Then you just need to apply the “color-override” to the room


Thank you for your reply. Your code block is not working i dont know why ?

Home.dyn (13.8 KB)

You cannot use the node the way you are doing…

Clockwork node is also returning a “color”!

1 Like

You are not using the right nodes for the colors. @Jonathan.Olesen didn’t use OotB nodes (i guess ?).

Use Color.ByARGB node and define your color or use the Palette.

1 Like

@mellouze As it says over my “color-nodes” they are from Clockwork… the OOTB way of making them is shown by @erfajo

@mohammadarslan You have not written either the “if-statement” (first codeblock) or the “transpose” block correctly…

Unless of course you only want two colors in which case there is no reason to use three colors… I’m just trying to show you an option not give you the entire solution. That way you might even learn a little from this adventure :slight_smile:

The logic behind the if-statement is:

if x < 40 then return “Red”
if x < 60 then return “Blue”
else return “Green”

And I’m only using the first two sub-lists (lst[0],lst[1]) in the transpose as the third list (lst2) is exchanged for actual colors rather than “values”…

Generally you can identify “function” by the color of the “header” of the nodes…

1 Like

Oh right, sorry, did not saw that :frowning:

Thank you for your reply. I will change my nodes :slight_smile:

The idea with the OOTB Color.Red etc. is to return the value of the channel… this is why it return “function” if it is not feeded with a “color” input.

1 Like

@Jonathan.Olesen I have now corrected it :slight_smile:

1 Like

I am quiet a beginner in Dynamo, but I am try to do something very similar to what you did here, change colors of rooms based on excel data that I have.I would really appreciate any leads or hints where to start and how to do it :slight_smile: