Hi everyone,
I have a simple 'floor area' rule based on one of the tutorials that takes a extruded shape, splits it into building floors, and then creates 'floors' from the bottom face of those floors, to report floor areas.
@Enum("Retail", "Commercial", "Residential")
attr Use = "Retail"
attr floor_height = 4
Init-->
split(y){ floor_height : Floors (Use) }*
Floors(type)-->
comp(f) {bottom: reverseNormals Floors_Areas(type)}
Floors_Areas(type)-->
case type == "Retail":
report("GFA.Retail", geometry.area)
color("#ff5733")
case type == "Commercial":
report("GFA.Office",geometry.area)
color("#44ff44")
else:
report("GFA.Residential",geometry.area)
color("#4444ff")
I've imported this rule into a 'master' rule which creates the basic volumes.
In the master rule I have 2 volumes, a ground floor volume, and an upper floor volume (which should be split into multiple floors by the imported 'floorarea' script.
import floors : "SplitAreas.cga"
@Enum("Retail", "Commercial", "Residential")
attr Use = "Retail"
@Enum("Yes", "No")
attr GroundFloor_Retail = "Yes"
attr groundfloor_height = 7
attr floor_height = 4
[script to create extrusions omitted]
GroundFloor-->
set(floor_height, groundfloor_height)
# above - I'm attempting to set the floor height used in the imported rule to the ground floor height attribute set in the master rule)
case groundfloor_retail == "Yes":
set(Use, "Retail")
floors.Init
else:
floors.Init
UpperFloors-->
floors.Init
I need to to somehow set both the value of "Use" and of "floor_height" in the imported script for the ground floor volume separately - see the attempts at doing this in bold above (this doesn't work).
In the example below, the value for "Use" (Commercial / Green) and floor_height (5) is successfully being pushed from the master rule into the imported rule and floors that creates. But for the ground floor mass, I'm trying to set the floor_height to 8, and for the use to be "Retail" / red.
Is that possible, or do I need to create a separate rule to call for the ground floor since it's height and use are different?
