@Range("A","B","C","D","E") attr groundfloorUse = "A" @Range("A","B","C","D","E") attr upperfloorUse = "A" reporting --> case groundfloorUse == "A" : report("F", 1) case groundfloorUse == "B" : report("G", 2) case groundfloorUse == "C" : report("H", 3) case groundfloorUse == "D" : report("I", 4) case groundfloorUse == "E" : report("J", 5) else: reporting2 reporting2 --> case upperfloorUse == "A" : report("A", 1) case upperfloorUse == "B" : report("B", 2) case upperfloorUse == "C" : report("C", 3) case upperfloorUse == "D" : report("D", 4) case upperfloorUse == "E" : report("E", 5) else: NIL
Solved! Go to Solution.
Thanks, you've saved my life!
const far_divider = 1000 const hdens_divider = 100 const junction_count = 5 const crossing_count = 5 const junction_multiplier = 3 const crossing_multiplier = 4 @Range (0,1) attr envelope_transparency = 0.5 @Range ("living", "commercial", "services", "industrial", "institutional", "recreational", "other", "water") attr groundfloorUse = "commercial" @Range ("living", "commercial", "services", "industrial", "institutional", "recreational", "other", "water") attr upperfloorUse = "living" @Range(1,2,3,4,5,6,7,8,9,10) attr groundfloorUse_floorcount = 3 @Range(1,2,3,4,5,6,7,8,9,10) attr upperfloorUse_floorcount = 3 attr floorheight = 4 @Range (0-20) attr frontSetback = 0 @Range (0-20) attr sideStreetback = 0 @Range (0-20) attr backStreetback = 0 lot --> shape report ("con", (junction_count * junction_multiplier) + (crossing_count * crossing_multiplier)) report ("ent", 0) #I leave it like this for now report1 report2 report3 shape --> s('1,0,'1) setback(frontSetback) { street.front: NIL | remainder: setback(backStreetback) { street.back: NIL | remainder: setback(sideStreetback) { street.side: NIL | remainder: ZoningShell } } } height = floorheight * ( groundfloorUse_floorcount * upperfloorUse_floorcount ) ZoningShell --> envelope(height, 0, 90) color zone1height = floorheight * groundfloorUse_floorcount zone2height = floorheight * upperfloorUse_floorcount floor_multiplier = groundfloorUse_floorcount + upperfloorUse_floorcount #living, commercial, services, industrial, institutional, recreational, other, water report1 --> case groundfloorUse == "commercial" : report("far1", (geometry.area(top) * floor_multiplier) / far_divider) case groundfloorUse == "living" : report ("hdens1", (geometry.area(top) * floor_multiplier) / hdens_divider) case groundfloorUse == "services" : report ("-", 0) case groundfloorUse == "industrial" : report ("-", 0) case groundfloorUse == "institutional" : report ("-", 0) case groundfloorUse == "recreational" : report ("-", 0) case groundfloorUse == "other" : report ("-", 0) else : report ("-", 0) report2 --> case upperfloorUse == "commercial" : report("far2", (geometry.area(top) * floor_multiplier) / far_divider) case upperfloorUse == "living" : report ("hdens2", (geometry.area(top) * floor_multiplier) / hdens_divider) case upperfloorUse == "services" : report ("-", 0) case upperfloorUse == "industrial" : report ("-", 0) case upperfloorUse == "institutional" : report ("-", 0) case upperfloorUse == "recreational" : report ("-", 0) case upperfloorUse == "other" : report ("-", 0) else : report ("-", 0)
example.1 count("cityengine", "e") # result = 2 example.2 count("cityengine rocks my world; cityengine should rock yours too", "cityengine") # result = 2