AnsweredAssumed Answered

Apply colors based on attribute values

Question asked by Christoph.Ruggli on Sep 12, 2018
Latest reply on Sep 13, 2018 by Christoph.Ruggli

Dear all

 

I try to wirte a cga rule for underground utilitys, especially pipes. I give the objects following information:

Height: VPKOTE

Radius: Radius 

Form: Model of Pipeline

Nutzungsart: Type of use (sewage, fresh water etc) which should be displayed with different colors

 

I don't understand why CE won't take the values out off the attribute table and colorize it...

 

 

This is my rule:


version "2018.0"


// Attributes
attr VPKOTE = 0
attr Radius = 0
attr Form = ("Pipe")
attr Nutzungsart = 0

 

// Functions
red = "#ffaaaa"
green = "#00ae00"
blue = "#aaaaff"
turquoise = "#ooebeb"
white = "#ffffff"
yellow = "#ffff73"
grey = "#9c9c9c"

 

// Start !

@StartRule

 

LOT -->
extrude(world.y, VPKOTE)
extrude(Radius)
color(Nutzungsart)


color -->
case Nutzungsart == 1 : color(red)
case Nutzungsart == 2 : color(green)
else : color (yellow)

PipeAsset =
case Form == "Pipe" :
"assets/pipe.obj"
else: "assets/pipe.obj"

 

I appreciate any help and tipps!

 

Thanks in advance

Christoph

Outcomes