Buildings not being generated in a new scene

559
4
06-28-2012 07:04 PM
JoanneO_Brien
Occasional Contributor
I've just created a new scene with three different building footprints, for Industrial, Comercial and Residential buildings. I'm trying to extrude a pretty basic rule onto these layers to create the different buildings based on height and colour as below:

/*Attributes-----------------------------------*/

//Heights

attr heightInd = 80% : 8
    10% : 6
    else : rand(4,15)
   
attr heightCom = 60% : 7
    30% : 4
    else : rand(4,15)
   
attr heightRes = 90% : 4
    else: rand(4,10)

attr red = "#ff0000"
attr blue = "#aaaaff"
attr green = "#46c820"




/*StartRules-------------------------------------*/

@StartRule
LotIndustrial--> extrude(heightInd) color(red)


@StartRule
LotCommercial--> extrude(heightCom) color(blue)


@StartRule
LotResidential--> extrude(heightRes) color(green)

This code should produce the buildings at different heights and colours based on the startRule, but when I assign and generate, nothing happens on my model! I was wondering if this was a problem with CityEngine or with my code? I'm using CityEngine Advanced 2011.2.
Tags (2)
0 Kudos
4 Replies
MatthiasBuehler1
Frequent Contributor
1]
toggle F12 --> Are the models visible at all ?

2]
try defining a shape name after the extrude
Lot -->
    extrude(5)
    Mass.
0 Kudos
JoanneO_Brien
Occasional Contributor
F12 worked perfectly! Thank's so much! What caused them to disapear then?
0 Kudos
JoanneO_Brien
Occasional Contributor
Actually worked out what F12 does just showing and hiding the models, feel a bit silly now but oh well, thanks anyway! 🙂
0 Kudos
MatthiasBuehler1
Frequent Contributor
I fell for this trap many times .. 😉
0 Kudos