I can't seem to make ApplySymbologyFromLayer work in ArcGIS Pro console, or in a scripting tool.

It works in an independant python script run in IDLE, but not when executed inside ArcGIS Pro GUI, neither from a scripting tool or the console.

For a basic "single symbol" symbology, this snippet should do the trick :

aprx = arcpy.mp.ArcGISProject("CURRENT")
map = aprx.listMaps(your_map_name)[0]


in_layer = map.listLayers(your_layer_name)[0]
symbology_layer = path/to/your/layer.lyrx
arcpy.management.ApplySymbologyFromLayer(in_layer, symbology_layer, None)

It doesn't matter weither I try to apply the symbology from a lyrx file or from a data layer present inside map. Changing arcpy.management.ApplySymbologyFromLayer to arcpy.ApplySymbologyFromLayer_management doesn't change the output either. Neither does replacing the "None" as a last argument of the function by #, or nothing.

When executed, these code blocks say they worked, but the symbology is unchanged on the map. However, it appears to be changed in the symbology tab.

Here, I have tried to apply a grey, 7 pt symbology to this layer currently in pink. It is still pink in the map, and in the TOC, but if you go in the symbology panel for this layer, you see the symbology it is supposed to have. enter image description here It looks like a bug to me for the symbology displayed on the map does not match the one you can see on the symbology panel.

Is there a way to make this command work when executed from within ArcGIS Pro console or from a scripting tool ?

I tried this at first using ArcGIS Pro 2.0. I recently updated to ArcGIS Pro 2.1, but the problem is still there. Also tried it on different computers and for different datas, and data types (points, lines, polygons)


In order to get this to work in your scripts inside ArcGIS Pro, I discovered it is best or even vital to first add the layers to the ArcGIS Pro TOC / Map, instead of just referencing them via a created Feature Layer. See the code below for an example.

Using this approach, I have been able to successfully update the layer symbology using the ApplySymbologyFromLayer_management tool with scripts running as a tool from a toolbox within ArcGIS Pro.

in_layer = YOUR CODE TO CREATE in_layer
in_symbology_layer = YOUR CODE TO CREATE in_symbology_layer

aprx = arcpy.mp.ArcGISProject("CURRENT")

aprxMap = aprx.activeMap # NOTE(!): 'aprx.activeMap' is only supported from Pro 2.1 onwards!!! activeMap returns None if script is called outside a running application according to ArcGIS Pro Help.

aprxMap.addLayer(in_layer, "AUTO_ARRANGE")
in_layer = aprxMap.listLayers(in_layer.name)[0]

aprxMap.addLayer(in_symbology_layer, "AUTO_ARRANGE")
in_symbology_layer = aprxMap.listLayers(in_symbology_layer.name)[0]

in_layer = arcpy.ApplySymbologyFromLayer_management(in_layer,in_symbology_layer,update_symbology="MAINTAIN")[0]
| improve this answer | |
  • Thank you so much for your answer. But adding the data to the map first is indeed what I've been doing. Sorry, my description was not specific enough, I added the whole "add your data to the map" bit to my question so there is no ambiguity anymore. Anyhow, if this works for you, maybe it is a problem with my computer/data, or something to do with my ArcGIS Pro version (2.0.1) – T Dog May 23 '18 at 12:34
  • Two more remarks: – Marco_B May 23 '18 at 14:03
  • Three more remarks: 1) I notice you set a None for the update_symbology String type option. Optional parameters which are the last ones in the list of parameters, do not have to be specified, so just leave that part out, or replace by e.g. "#", which is the way to specify parameters you don't want to enter. 2) I recommend you to rename either the "in_layer" or the "in_symbology_layer" if the layers happen to have the same name. Do this before adding them to the TOC! This will avoid naming ambiguity for the layers. 3) Definitely upgrade to the latest Pro edition. ESRI is still fully bug fixing. – Marco_B May 23 '18 at 14:11
  • 1
    So, updated my ArcGIS Pro, to version 2.1.3, and it still doesn't work. I'm going to add some screenshots to the question to document it as much as possible. – T Dog May 29 '18 at 9:22
  • 1
    I'm really surprise. I don't see how the problem could come from my system. It really has the appearence of an ArcGIS Pro bug. Anyway, if it works in your project, I don't see another explanation either. I'll try to investigate a bit more, and if I fail to find anything, I'll close this question, as the problem doesn't seem to be reproductible. Thank you very much for your help anyway – T Dog May 30 '18 at 12:46

This is still logged with ESRI as a bug: https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEwODQ5Nw== Bug BUG-000108497 -Running the Apply Layer Symbology tool as a script in the Python window does not update the symbology in the map.

Still not fixed. Alternate solution is 'close and reopen the project' (??)

| improve this answer | |

Using ArcGIS Pro 2.6.1

I found that passing a layer object through the ApplySymbologyFromLayer() function, as the first arg, does not work. For whatever reason, you should pass a string through it. So basically change your line from:

in_layer = arcpy.ApplySymbologyFromLayer_management(in_layer,in_symbology_layer,update_symbology="MAINTAIN")[0]


in_layer = arcpy.ApplySymbologyFromLayer_management(str(in_layer),in_symbology_layer,update_symbology="MAINTAIN")[0]

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.