Select to view content in your preferred language

Adjust attribute dimensions based on split part

249
1
08-03-2024 11:00 PM
jabrett
Emerging Contributor

Hi, 

I'm trying to create a T-shape (to ultimately put into a recursive extrude floor function). I'm trying to make the setback adjust according to the respective split part. Does anyone have any suggestions? Apologies I don't have a lot of cga coding experience. Thanks!

version "2023.1"
 
######################################################
#ATTRIBUTES
######################################################
//Initial shape with attributes for width or setback
attr frontSetback = 3
attr rearSetback = 3
attr sideSetback1 = 3
attr sideSetback2 = 6
 
attr LotArea = 0 # used to calc FSR
attr width = 0
 
######################################################
#FUNCTIONS#
######################################################
 
 
 
######################################################
#RULES
######################################################
 
LotInner -->
   Lot
        
Lot -->
   shapeO(frontSetback,sideSetback1,rearSetback,sideSetback1) { shape: Border | remainder: Footprint }
   split(z){ ~23 : Part("Front") | ~40 : Part("Rear")}
 
Part(name) -->
case name == "Front" : setDimensions(3)
case name == "Rear" : setDimensions(6)
else: Nil
 
setDimensions(newWidth) -->
s(newWidth,'1,'1)
color("#FF0000")
X
 

 

 

 

0 Kudos
1 Reply
ThomasFuchs
Esri Regular Contributor

Hello @jabrett 

Thanks for submitting this question. When defining setbacks, it is not necessary to use shapeO(). Please use the setback operation—ArcGIS CityEngine Resources | Documentation instead.

To create the T-shape  you also want to use the t operation—ArcGIS CityEngine Resources | Documentation to translate the scope after adjusting it's size.

0 Kudos