0

I am trying to apply a graduated color symbology from one layer to another. The script adds a layer to an mxd but foes not apply the symbology from the symbology layer.

Can someone tell me what I am doing wrong?

This did work a few days ago for other layers but is no longer working.

This is the script, path names modifiied

import arcpy

arcpy.env.workspace = r"C:\Workarea\BrandiS"

mxd = arcpy.mapping.MapDocument(r"C:\Workarea\BrandiS\SymbolTest.mxd")

df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]

featureLayer = r"C:\Workarea\BrandiS\TestLayer.lyr"

addLayer = arcpy.mapping.Layer(featureLayer)
arcpy.mapping.AddLayer(df, addLayer, "TOP")

if addLayer.symbologyType == "GRADUATED_COLOR":
   addLayer.symbology.valueField = "Join_Count"

symbolLayer = r"C:\Workarea\BrandiS\SymbolLayer.lyr"

arcpy.mapping.UpdateLayer(df, addLayer, symbolLayer)

mxd.save()

del mxd, df, featureLayer, addLayer, symbolLayer
2
  • What's the error you faced? Please copy the entire error text in this question.
    – BBG_GIS
    Commented Mar 9, 2019 at 21:34
  • I am not getting any error messages. There is just no change, but if I do it manually with the same layers it works just fine.
    – blayne
    Commented Mar 12, 2019 at 14:23

0

Your Answer

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

Browse other questions tagged or ask your own question.