# Extrude elevation instead of height

361
4
12-15-2013 08:42 AM
New Contributor
Hi,

I'm a new user of CityEngine, i'm a engineering student in topography (french).

I would like to know if it's possible to get the coordinates of a shape in order to use them in the python code ?

For example I have a shape at the elevation of 400 meters and I'd like to extrude it until 420 meters.

Something like this:

attr shapeType = ""
attr Altitude = 420

@StartRule
Height = Altitude - (?? get the shape elevation ??)

Lot -->
case shapeType == "LotInner" :
Lot.
else :
extrude(world.y, Height) comp(f) { side : Wall | top : Roof }

Tags (2)
4 Replies
New Contributor II
Hi there,

are you looking to extrude the building to it's actual height? (e.g are you trying to make an accurate representation of a real life building?)

also is the 400m altitude an attribute of the underlying terrain?
New Contributor

I have a Raster DTM at around 400 m.
I have aligned shapes to terrain.
So my shapes have all a different altitude. Around 400 meters.
Yes i'm trying to make an accurate representation of real buildings, wich I know their top altitude.

I would like to extrude buildings at 420 m for example. Ok I can extrude 20 m.
But how to use the altitude ? How can I get the altitude of the shape ?

Then I could have:

attr Altitude = 420 m

Height = Altitude - ShapeAltitude

extrude(world.y, Height) ...
New Contributor II
I am not aware of any way that you can determine the altitude from the DTM in order to use it within a rule file (although someone may be able to tell you differently??)

Obviously in your case this would be useful as it would allow you to create a rule whereby building height= TopofShapeAltitude-DTMaltitude.

Instead, perhaps you could look at using arcMap for example in order to create an attribute for your building lots?
eg. If you had DTM and DSM you could work out building height by DSM-DTM.

That way you could extrude to your building height attribute without having to worry about any calculations within CityEngine?
Frequent Contributor
hi Jamie,