How to use ApplySymbologyFromLayer in Python-script?

3110
10
10-26-2017 12:40 AM
ThomasKölbel
New Contributor II

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.

10 Replies
KevinMayall
Occasional Contributor III

Same issue.  Has anyone submitted a support ticket for this?

 

Kevin
0 Kudos