AnsweredAssumed Answered

CGA Code - No color option

Question asked by z5010570_UNSW on May 23, 2016
Latest reply on May 23, 2016 by MicahShane

Hi,

I´m writing a rule to colorize a facade that goes as follows. One of the Options I want is to not colorize, but I don´t know what I should write in that case (highlighted in red). Can you help me?

 

Thanks you,

 

Marta

 

------------------------------------------------------------------------------------------------------------

 

@Group ("Colors")

attr green = "#007d34"
attr orange = "#f59e00"
attr red = "#cd071e"
attr grey = "#c4c4c4"

 

@Group ("EnergyState")

attr UValue_Is_Facade = 0 // Current u-value

attr UValue_Reg_Facade = 0 // U-value corresponding with the regulation

attr UValue_Rec_Facade = 0 //Recommended u-value

 

@range(0,1,2,3)
attr UValueColorizer_Facade = 0 // 0 = no color, 1 = UValue_Is_Facade, 2 = UValue_Reg_Facade, 3 = UValue_Rec_Facade

 

ColorizerUValueSwitch_Facade -->
case UValueColorizer_Facade == 0 : Colorizer_Off_Facade
case UValueColorizer_Facade == 1 : Colorizer_UValue_Is_Facade
case UValueColorizer_Facade == 2 : Colorizer_UValue_Reg_Facade
else: Colorizer_UValue_Rec_Facade

 

Colorizer_Off_Facade -->
color ()

Colorizer_UValue_Is_Facade -->
case UValue_Is_Facade < 1 && UValue_Is > 0 : color (green)
case UValue_Is_Facade < 2 && UValue_Is > 1 : color (orange)
case UValue_Is_Facade < 3 && UValue_Is > 2 : color (red)
else: color (grey)

 

Colorizer_UValue_Reg_Facade -->
case UValue_Reg_Facade < 1 && UValue_Is > 0 : color (green)
case UValue_Reg_Facade < 2 && UValue_Is > 1 : color (orange)
case UValue_Reg_Facade < 3 && UValue_Is > 2 : color (red)
else: color (grey)

 

Colorizer_UValue_Rec_Facade -->
case UValue_Rec_Facade < 1 && UValue_Is > 0 : color (green)
case UValue_Rec_Facade < 2 && UValue_Is > 1 : color (orange)
case UValue_Rec_Facade < 3 && UValue_Is > 2 : color (red)
else: color (grey)

Outcomes