Code Block Script

Hi Guys,

I have one question about a code block.

I have as input three elements:

S = Supply Heating
D = Design Heating
A = D/S

I’m using a code block in order to change a parameter value for spaces (Colors).
I would like to write something like this:

if S==0 && D==0 then the parameter value has to be “White”
elif S==0 && D!=0 then the parameter value has to be “Black”
elif S!=0 && D!=0 && 0.8<A then the parameter value has to be “Red”
elif S!=0 && D!=0 && 0.8=< A >=1.2 then the parameter value has to be “Green”
elif S!=0 && D!=0 && A>1.2 then the parameter value has to be “Blue”
else the parameter value has to be “Unknown”

This is what I’ve done by now but it doesn’t work (I’m not really good with programming as you can see):

Thanks guys!

1 Like

Don’t like DS so grab python

ib

1 Like

Thanks Tomasz :slight_smile: