# Adjust the probability that a building is created on a lot

3447
1
03-16-2015 06:54 AM
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.

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 }

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 }