Select to view content in your preferred language

Renaming alias

608
1
12-15-2011 02:16 AM
FugroSurvey_Ltd_
Emerging Contributor
Hello everyone,

I'm trying to start learning python so everything is totally new for me. What I would like to do is a macro to change my feature classes/shapefiles aliases displayed on the TOC. Basically I need to export this data into a CAD DGN/DXF with specific levels names and ArcMap picks the alias displayed. Unfortunately this is not the correct levels name so I either have to do it manually or run some kind of macro to do it for me.

Any help would be much appreciated.

Thanks
Tags (2)
0 Kudos
1 Reply
JasonPardy
Emerging Contributor
Hi Patricia,

Unfortunately, there is no method available in Python that allows you to alter or update the alias name of a table or feature class. There will be a new method in ArcGIS 10.1 to do this:

arcpy.AlterAliasName(table, alias_name)


One alternative (other than using ArcObjects), is save all the layers in the TOC to layer files and use them from that point forward. You can do this right from the Python window in ArcGIS 10.

>>> mxd = arcpy.mapping.MapDocument('current')
>>> layers = arcpy.mapping.ListLayers(mxd)
>>> for layer in layers:
...     layer.saveACopy(os.path.join(r'c:\temp', layer.name), "10.0")

Jason
0 Kudos