Adjust the probability that a building is created on a lot

3446
1
Jump to solution
03-16-2015 06:54 AM
PetrBocharnikov
New Contributor

In the example from Tutorial 8: Mass modelling, is there a possibility to replace hardcoded percentage with an attribute? So instead of 50% to have the attribute there that can be adjusted from 0% to 100% in the inspector?

LShape -->

50% : shapeL(wingWidth, wingWidth) { shape : LFootprint }

else : rotateScope(0, 90, 0) shapeL(wingWidth, wingWidth) { shape : LFootprint }

I am looking for a way to control an overall volume of buildings that CE creates in an area consisting of many lots, and I thought that one way to achieve that is to adjust the probability that a building is created on a lot.

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Hi Petr,

Try this:

attr yourPercentage = rand    #same as rand(0,1)

LShape -->

case p(yourPercentage): shapeL(wingWidth, wingWidth) { shape : LFootprint }

else : rotateScope(0, 90, 0) shapeL(wingWidth, wingWidth) { shape : LFootprint }

View solution in original post

1 Reply
by Anonymous User
Not applicable

Hi Petr,

Try this:

attr yourPercentage = rand    #same as rand(0,1)

LShape -->

case p(yourPercentage): shapeL(wingWidth, wingWidth) { shape : LFootprint }

else : rotateScope(0, 90, 0) shapeL(wingWidth, wingWidth) { shape : LFootprint }