AnsweredAssumed Answered

CityEngine assign color from attribute

Question asked by heathmanderson on Dec 23, 2013
Latest reply on Jan 3, 2014 by MBuehler-esristaff
I am trying to assign a color based on an attribute from my shapefile.  The attribute is "diskcolor" and is a string.  Here is my code

//Attribute
attr diskcolor = ""

//Functions
Red = "FF0000"
Blue = "0000FF"
Yellow = "FFFF00"
White = "FFFFFF"

// Start !
@StartRule
disk = fileRandom("assets/disk.obj")

Lotdisk--> r(-90,0,0) s(0,1,0) center(xz) i(disk) disk.
Colorizer
Colorizer-->
case diskcolor == "1" :
color(Red)
case diskcolor == "2" :
color(Blue)
case diskcolor == "5" :
color(Yellow)
else :
color(White)

Can someone please help. I am not sure what is wrong, but i believe that the code is not getting the attribute from the shapefile even though I have set the source as "Layer attribute"

Thoughts?
[ATTACH=CONFIG]30082[/ATTACH]

Attachments

Outcomes