AnsweredAssumed Answered

Changing Layer Symbology with Python

Question asked by wildhog on Nov 13, 2019
Latest reply on Jun 27, 2020 by LeasMaps

I'm having problems changing layer symbology in ArcGIS Pro using Python. I have a feature class where the symbology has changed because the data in the fields used to define the symbolgy has changed. I'm trying to use Python to create a list of layers that need to be changed and then updating the symbology using the ApplySymbologyFromLayer function.

 

However; in Pro I am unable to make any changes using an IDE. If I try to use the Python window in Pro then it only updates the first target layer; but it updates that first layer for as many times as the number of items in the layer list. The only way I can update the symbology correctly is to use the Python window in Pro and rename all the target layers so they have different names. 

 

Conversely, in Desktop I am able to create a list of layers and use the ApplySymbologyFromLayer with no problems; whether I use an IDE or the Python window. 

 

Does Pro treat layer objects differently for some reason? I've noticed that using the geoprocessing method for importing symbology layers with the same name have a number appended to the end. 

 

How can I make changing the layer symbology in Pro with Python work? 

Outcomes