Thursday 26 September 2019

arcgis 10.0 - Changing feature class and field aliases in bulk using ArcPy?


I have over a hundred FCs, each with 10 or 20 attributes to add or change the aliases for, two or more times a year. Needless to say, this is not something I'm going to grunt my way through. How can I automate this process?


Python solution preferred but will use anything that works.


I have access to Arcgis 9.3.1 and 10 (ArcInfo license level).



Answer




As of version 10.1 AlterAliasName() can be used to re-alias tables:


table = r"C:\path\to\connection.sde\OWNER.TABLE"
arcpy.AlterAliasName(table, "table_alias")

As of version 10.3 Alter Field can be used to re-alias fields:


table = r"C:\path\to\connection.sde\OWNER.TABLE"
arcpy.AlterField_management(table, "FIELD_NAME", new_field_alias="field_alias")

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...