Automatically apply different rules to roads and sidewalks

2034
3
08-02-2013 02:06 AM
ThibaultThibault1
New Contributor II
Hi,

I have a CGA file named "street.cga" with 2 rules :

@StartRule
Road --> ...

@StartRule
Sidewalk --> ... 


I imported polyline shapes from a file GDB representing my streets.

In my Streetnetwork , in one shape, I manually select the road (the middle part) and apply the "street.cga" rule and assign the "Road" starting rule. I manually select both sidewalks (both part on the road side) and I apply the "street.cga" rule and assign the starting rule "Sidewalk".

I have the expected result for one shape of my Streetnetwork. But I have 600 shapes and I would like to find a way to automatically select the road or the sidewalk and apply the related starting rule.

I can't figure out how to do this automatically.

I have tried with split and comp, but without success.

Do you have any idea how to do this ?

Thank you.
0 Kudos
3 Replies
MatthiasBuehler1
Frequent Contributor II
Hi !


Why are you using 'Road' and not the default which is 'Street' ?

Street and Sidewalk are the default Start Rules which are set by CityEngine. So if you have according start rules in your code, then everything works automatically.

Of course you can override those defaults, but it just makes your life harder.

-->

1] create your street shapes
2] select 1 shape > RMB click > select shapes in same layer
3] drag and drop rule on those selected shapes
4] done.

Note that drag-n-drop automatically triggers the model generation if the @StartRule annotations are well-defined.

ok ?
0 Kudos
ThibaultThibault1
New Contributor II
Thanks Matthias,

It works as you described it.

In my case I had to :

  • Select all shapes in my Streetnetwork

  • In the Cityengine main menu, click "Graph"

  • Select "Reset Shape Attributes"


I have tried with a fresh new import from a file GDB and your scenario works well.
For other begginers like me, may I had one step in between steps 3 and 4 :

  • On the "Set Start Rule" window, choose "Skip"


The help page about this topic.

After setting the rules properly, I guess for the generation to be error free, all the default start rules must be defined :

  • Street

  • Sidewalk

  • Crossing

  • Junction

  • JunctionEntry


Thibault
0 Kudos
MatthiasBuehler1
Frequent Contributor II
correct. :)

m.
0 Kudos