I am using CityEngine version 2024, and I am getting an unexpected token error on the following function:
Lot -->
// Apply setbacks using positional parameters (front, right, back, left)
setback(SETBACK_F, SETBACK_S, SETBACK_R, SETBACK_S)
{ remainder: Footprint | inside: NIL }
I attached the CGA file for your reference.
Hi @ElieRizk,Your call to the setback operation needs to follow the correct syntax: setback operation—ArcGIS CityEngine Resources | Documentation.You are probably looking to something like this?
setback(SETBACK_F){front: NIL | remainder: setback(SETBACK_R){back: NIL | remainder: setback(SETBACK_S){left: NIL | remainder: setback(SETBACK_S){right: NIL | remainder:Footprint}}}}
Hope that helps.
Hi @ElieRizk ,
The setback operation syntax is different to what you have in your CGA rule. If you are looking for individual setbacks per side, see the examples at bottom in the setback cga reference.
Here is a basic snippet:
@Range(min=1, max=25) attr setback_front = 10 @Range(min=1, max=25) attr setback_left = 3 @Range(min=1, max=25) attr setback_right = 2 @Range(min=1, max=25) attr setback_back = 5 const dists = comp(fe) { front : setback_front | left: setback_left | right: setback_right | back: setback_back } @StartRule Lot --> setback(dists) { all = Garden. | remainder : Building } Building --> extrude(15)
Hope this helps!
Best,Jonas
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.