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"
After some additional research and trail and error I was able to get the code to work. I had to change some things around then remove and add the shapefile but it works.
//Attribute attr dcolor = "" # string !
//Functions Red = "#FF0000" Blue = "#0000FF" Yellow = "#FFFF00" White = "#FFFFFF"
// Start ! @StartRule disk = fileRandom("assets/disk.obj")
After some additional research and trail and error I was able to get the code to work. I had to change some things around then remove and add the shapefile but it works.
//Attribute attr dcolor = "" # string !
//Functions Red = "#FF0000" Blue = "#0000FF" Yellow = "#FFFF00" White = "#FFFFFF"
// Start ! @StartRule disk = fileRandom("assets/disk.obj")