Select to view content in your preferred language

Error in Esri rule files?

4047
11
Jump to solution
08-12-2015 07:50 AM
awei
by
Occasional Contributor

Seems there're errors in City Engine Essential Skills Training project/Essential_street.cga. Specifically, these few lines:

PlantingLayout -->
  case lenAlongV > 2 && lenAlongU > 8  && heightOverTerrain < 2:
  split(u,unitSpace,0)
  {
  Crosswalk_width * 2: Pavement | 
  split(v,unitSpace,0)
  {
  Planting_Width : split(u,unitSpace,0)
  { 
  Planting_Length  : PlantingOrPavement | { Planting_Spacing:  Pavement | Planting_Length : PlantingOrPavement }* | ~1 : Pavement
  } 
  | ~1 : Pavement
  }
  | Crosswalk_width * 2: Pavement
  }
  else :  Pavement

Am I mistaken? If there're errors, how do I fix that?

Thank you!

0 Kudos
1 Solution

Accepted Solutions
MicahTaylor
Frequent Contributor

Try the rule now (attached)...I was able to generate the following with this rule (image)

View solution in original post

11 Replies
MicahTaylor
Frequent Contributor

Remove the Bar after Pavement.

0 Kudos
awei
by
Occasional Contributor

yeah but that created more errors

0 Kudos
MicahTaylor
Frequent Contributor

Hmm.  This seemed to fix the error in my code.  I know we are using the same file, but could you upload your Essential_Street.cga so I can use it?  I might be able to see what is different about your copy.

Thanks!

0 Kudos
awei
by
Occasional Contributor

Uploaded! Thank you Micah!

0 Kudos
MicahTaylor
Frequent Contributor

Try adding this asterisk...This will run this line of code for the entire sidewalk until it ends that segment.

0 Kudos
MicahTaylor
Frequent Contributor

Also, here is a link to the Complete_Street rule. It offers many more options and will most likely be of more use to you.

https://community.esri.com/external-link.jspa?url=http://www.arcgis.com/home/item.html?id=863f4e7139...

by Anonymous User
Not applicable

a wei,

Can you provide a link to the place where you downloaded the code? I can see several errors, but I'd like to see the publically posted version, so I can correct it before others download it.

One thing that seems to be happening here is that there was a change in CGA, so the inside of splits, everything separated by pipes must have a length specified.

Part of the old code shown above, which worked in older versions:

split(u,unitSpace,0)  { Crosswalk_width * 2: Pavement |  split(v,unitSpace,0)  { ...

Must change to have a length in both parts, like this:

split(u,unitSpace,0)  { Crosswalk_width * 2: Pavement |  SomeValue: split(v,unitSpace,0)  { ...

SomeValue could be:

~1   (means just whatever space is left. this is easiest fix)

'0.5   (means relative 50%)

123  (a literal value)

something * somethingElse   (a calculated value like Crosswalk_width * 2, as seen above)

So this is just one error I noticed. More might be there. Please send link to download where you got this if possible.

Thanks!

Chris

awei
by
Occasional Contributor

Hey Chris,

Thanks for the reply. I downloaded the rule from this #6 CityEngine Essential Skills: Importing Streets - YouTube

From the link from that video.

0 Kudos
MicahTaylor
Frequent Contributor

Try the rule now (attached)...I was able to generate the following with this rule (image)