​x
46
 
1
/**
2
 * File:    ZoningColors.cga
3
 * Created: 17 Oct 2017
4
 * Author:  ewittner
5
 */
6
​
7
version "2017.1"
8
​
9
// Add additional names & colors depending on how many different zoning types you have
10
@Group("Zoning Colors")
11
attr residentialColor = "#FFFF00"
12
@Group("Zoning Colors")
13
attr commercialColor    = "#FF0000"
14
@Group("Zoning Colors")
15
attr industrialColor    = "#A020F0"
16
@Group("Zoning Colors")
17
attr greenspaceColor    = "#228B22"
18
@Group("Zoning Colors")
19
attr parkingColor   = "#D3D3D3"
20
​
21
​
22
// Change "ZONING" to whatever the name of your field is for the zoning category, then add additional cases until you've covered all the zoning types
23
​
24
@Range("Residential", "Commercial", "Industrial", "Green Space", "Parking")
25
attr ZONING = "Residential" 
26
attr HEIGHT = 1
27
​
28
​
29
@StartRule
30
Zones --> 
31
    case ZONING == "Residential" :
32
        color(residentialColor)
33
        extrude(world.up, HEIGHT)
34
    case ZONING == "Commercial" :
35
        color(commercialColor)
36
        extrude(world.up, HEIGHT)
37
    case ZONING == "Industrial" :
38
        color(industrialColor)
39
        extrude(world.up, HEIGHT)
40
    case ZONING == "Green Space" :
41
        color(greenspaceColor)
42
        extrude(world.up, HEIGHT)
43
    case ZONING == "Parking" :
44
        color(parkingColor)
45
        extrude(world.up, HEIGHT)
46
    else : NIL