Hi there,
I'm having a problem with a rule file I inherited. The original rule file was written for CityEngine 2016. I would like to update it so it runs in CityEngine 2020.
I am getting a recurring error: Unexpected token. This error is repeated throughout the code wherever there is a decimal value.
A snippet of the code throwing the error is below and I have attached a screenshot of the errors.
Any and all help is appreciated!
Lot1 -->
#Where there is no commercial in the suburb and the % of residential buildings is >0
case NoCommercialInSuburb == "No Commercial" && PercentBuildingsResid > 0 :
set(Ground_Floor_Resid, "GroundFloorResid")
set(First_Floor_Resid, "FirstFloorResid")
set(PercentUpperFloorResid, 1)
Lot1.5
# Default method of allocating floorspace between residential and non-residential is to do so by floor.
# This code below checks the ResidAllocationMethod parameter and switches the allocation method to building by building instead.
case ResidAllocationMethod == "By building" && (FixedRandomNumber/100) <= PercentBuildingsResid :
set(Ground_Floor_Resid, "GroundFloorResid")
set(First_Floor_Resid, "FirstFloorResid")
set(PercentUpperFloorResid, 1)
Lot1.5
case ResidAllocationMethod == "By building" && (FixedRandomNumber/100) > PercentBuildingsResid :
set(Ground_Floor_Resid, "GroundFloorNonResid")
set(First_Floor_Resid, "FirstFloorNonResid")
set(PercentUpperFloorResid, 0)
Lot1.5
else :
Lot1.5
Solved! Go to Solution.
I think CityEngine uses the decimals in text strings to find file paths. You might do a quick find/replace of "Lot1.5" to "LotB" and see if that solve your problems.
For example:
import Complete_Streets <file path>
call the rule: Complete_Streets.Sidewalks or Complete_Streets.Streets
I think CityEngine uses the decimals in text strings to find file paths. You might do a quick find/replace of "Lot1.5" to "LotB" and see if that solve your problems.
For example:
import Complete_Streets <file path>
call the rule: Complete_Streets.Sidewalks or Complete_Streets.Streets
Hi Brian,
That seems to have solved my problem.
Thanks for your help!