Select to view content in your preferred language

How to add a model to a scatter operation

633
1
12-06-2023 07:53 AM
JasonKarian2
Occasional Contributor

Hey CityEngine Community,

I'm currently trying to leverage a basic "scatter" operation in my rule to allow for a few models to be scattered across a shape. This is the current code I have (again, very basic):

attr model1 = "assets/CornExport_0.dae"
attr model2 = "assets/source/Marul.fbx"

@StartRule
Lot -->
     scatter(surface, 50, uniform ) {model}

 

When I run the rule on the shape, the below image is given, which is just circular shapes. I've tried changing the {model} to match the imports (i.e. model1), but CityEngine throws the Duplicate Rule error at me, so I don't think I can call it there. 

Any help in fixing my rule and helping me understand where I went wrong would be appreciated!

JasonKarian2_0-1701877990599.png

 

0 Kudos
1 Reply
SimonHaegler
Esri Contributor

Hi,

in your rule snippet, "model" is not defined and neither "model1" nor "model2" are used in an "insert" statement to actually read the assets.

Try to add this rule:
model --> i(model1)

Hope this helps & best,
Simon