I created a python tool on Pro with the following code, and manage to run it without any errors or warnings. However, I do not see any changes on my layer:

workspace = "C:\whatever.gdb"
arcpy.env.workspace = workspace
ref_lyrx = r"C:\SimbologyIwant.lyrx"
aprx = arcpy.mp.ArcGISProject("CURRENT")
map = aprx.listMaps('Map')[0]
layers = map.listLayers()[0]
layers2 = map.listLayers()[1]
arcpy.ApplySymbologyFromLayer_management(layers2, layers)

I also changed the last line to this, but no results

arcpy.ApplySymbologyFromLayer_management(layers2, ref_lyrx)

Is my code expected to work?

  • 1
    Are you running the script in ArcGIS Pro or as a stand-alone script? Commented Sep 20, 2019 at 18:27
  • I created a script tool with that code. Forgot to mention, but the code works without any errors.
    – Gustavo
    Commented Sep 20, 2019 at 18:33

1 Answer 1


After changing the layer symbology you need to save the project.

aprx.save ()

  • 1
    Thanks for your help. Its not that simple, I could only manage to make it work with the project closed (running the tool in a unrelated project). I hope that there is a more straightforward way to do it.
    – Gustavo
    Commented Sep 20, 2019 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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