Coloring rooms based on the excel file values

Hi

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

|Room|1|20|
|Room|2|30|
|Room|3|40|
|Room|4|50|
|Room|5|60|
|Room|6|70|

image

Maybe something like:

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

4 Likes

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

Home.dyn (13.8 KB)

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…
image

1 Like

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

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

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

1 Like

hello,
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: