Extrude shapefile according to height attribute

9788
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
AndréCardoso
New Contributor III
Time to give back to community :)

Here are the steps:
1- import the shapefile
2- create a rule file and define an attribute with the same name as the one found on the shapefile
3- associate the rule file to each shape imported onto the scene

Look at the screens attached :).

After importing the shapefile and creating the rule which uses a attribute with the SAME name as the one found on the object attributes, you just have to make sure that the rule file is associated to the shapes, and that the attribute from the CGA is sourced to read its value from each shape's attributes.



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
0 Kudos
MatthiasBuehler1
Frequent Contributor II
@ Andre

thanks for joining me on the support front ! ;)

amazing, you're even using the @StartRule decoration !!!
0 Kudos
CarlBester
New Contributor
Great!

Thank you Andre! It worked.
0 Kudos
roberthughes
New Contributor
brilliant, helped a lot, thank you soo much for this reply!
0 Kudos
AmberKenyon
New Contributor

I've followed these steps and applied them to my buildings but they don't seem to be extruding?

I have attatched a number of screenshots to show what I have done. If anyone could help that would be great. CityEnginecity.PNGextr_code.PNG

0 Kudos
LR
by
Regular Contributor

Seems fine, are you sure you didn't turn off the models? It's the black house icon on the viewport (not shown in the screenshot ).

0 Kudos
AmberKenyon
New Contributor

No its definitely selected and still not working!

0 Kudos
LR
by
Regular Contributor

No idea then. Try making a new project, or maybe you can upload some sample data?

0 Kudos
valeriisendetskyi
New Contributor II

Hi,
tried to use this method to make geometry form GIS data but failed. Looks like the problem is that imported data has HEIGHT attribute with STR type.
And connection editor does not recognize it. If I create similar attribute with FLOAT type everything works nice.
Can somebody make a suggestion on how to get over this problem please.
Tried to reimport data. Not working.

Here's the screen of what I'm talking about: Attribute Connection Editor

Visual difference between FLOAT and STR atrributes is that STR does not have slider.
Would really appreciate some help. Creating all new attributes for every shape is not a solution(

0 Kudos