Extrude shapefile according to height attribute

11899
13
02-29-2012 09:53 PM
CarlBester
New Contributor
Hi,

I have imported a shapefile into CityEngin and need to extrude the buildings according to an existing height attribute in the shapefile. For example: If there are 3 buildings with height values of 30; 70; 20. Then the buildings have to be extruded according to each one's value.
Do I need to create an attribute which represents the height attribute for each specific shape? The height attribute is Building_height.

attr z = Building_height
Lot --> Shape extrude(z)

Do I need to define the shapefile in the rule code?

Any help will be greatly appreciated
Tags (2)
0 Kudos
13 Replies
LR
by
Occasional Contributor III

Convert it to float:

attr HEIGHT = ""
Lot -->
  extrude(float(HEIGHT))

If you want to use a slider to adjust the height afterwards you can do this:

@Hidden #optional
attr HEIGHT = ""
attr myHEIGHT = float(HEIGHT)
Lot -->
  extrude(myHEIGHT)
valeriisendetskyi
New Contributor II

Thanx for reply.
But it doesn't want to take it either.
I've reloaded the rule, but nothing changed.
Would have been cool to convert attribute permanently. As a separate action. But I'm not good enough in CE to figure it ou

proof: Attribute Connection Editor

0 Kudos
LR
by
Occasional Contributor III

You have to define it properly in the rule too, i. e. height ="", not height = 0, because then the rule assumes it's a float and won't connect to your str object attribute.

valeriisendetskyi
New Contributor II

Thanx a lot! Now it works perfectly)

0 Kudos