I am on ArcGIS 10.4.1.
I have an .mxd file with a bunch of layers. The underlying database table has got new aliases for certain fields and I would like to get this reflected in the fields aliases for the corresponding layers.
If I remove the layer and add the feature class, I have to re-set the symbology + all other layer properties such as scale ranges, labels etc.
If I save the .lyr file first and re-apply it using
arcpy.mapping.UpdateLayer
, I will get back all the symbology, but also the field aliases which I don't want.If I set the
symbology_only=True
, I will need to re-set all other properties manually.
I have seen the ArcObjects code and am able to update it using comtypes
and C# code, however I wonder whether there is a way to update the layer's field aliases using arcpy
.
I have seen that ArcMap X-Ray add-in has functionality of updating field aliases for the map document layers, great one. However, this should be done for every map document manually, thus it's impossible to script.