AnsweredAssumed Answered

How to use ApplySymbologyFromLayer in Python-script?

Question asked by abdsz22 on Oct 26, 2017
Latest reply on Oct 26, 2017 by Dan_Patterson

ArcGIS Pro 1.4, 2D-Map

I'm trying to change the symbology of a featureclass  through a layerfile (.lyrx):


import arcpy

arcpy.MakeFeatureLayer_management("myFc", "myFc_lyr")

inputLayer = "myFc"
symbologyLayer = "myFc.lyrx"
symbologyFields = [["VALUE_FIELD", "StrKlasse", "StrKlasse"],["VALUE_FIELD", "Abschnitt_Ast", "Abschnitt_Ast"]]

arcpy.ApplySymbologyFromLayer_management (inputLayer, symbologyLayer, symbologyFields)


Running the commnds in the python-window, the symbology will be changed as expected, but in a python script from a toolbox nothing happens. The attributes in lyrx-file and the fc/layer match correctly.

Thanks for any solution.