How to add a model to a scatter operation

12-06-2023 07:53 AM
New Contributor II

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"

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!



0 Kudos
1 Reply
Esri Contributor


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,