Coloring rooms based on the excel file values

revit
excel
dynamo
color-override
rooms

#1

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


#2

Maybe something like:

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


#3

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

Home.dyn (13.8 KB)


#4

You cannot use the node the way you are doing…

Clockwork node is also returning a “color”!


#5

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.


#6

@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


#7

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


#8

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


#9

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.


#10

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