Select to view content in your preferred language

Generate object names from a value from the object attributes in CityEngine

981
1
03-31-2019 11:27 AM
NelsonSchäfer1
New Contributor

I have a shapefile with buildings and imported it into CityEngine. All the objects in CityEngine get named automatically. Is there a way to change to generate custom object names from a value in the object attributes table (with a rule file) ?How to automatically assign the value GEBID as the object name?

Tags (1)
0 Kudos
1 Reply
ChristianIten
Esri Contributor

Hi Nelson

Pls find attached a python module that should solve your problem.

Copy the .py file into the script folder of your project.

In order to make it work you need to replace "myAttr" with the attributes name you want to use. Save it afterwards.

Select the shapes you want to rename only.

With the python script open in the editor go to Python -> Run 

the selected shapes should now be renamed.

Note: this script is intended to work exactly for this case. it doesn't handle edge cases such as attribute does not exist, etc.