m.dekeizer@argusi.org

No symbology for layer object

Discussion created by m.dekeizer@argusi.org on Feb 3, 2017
Latest reply on Feb 6, 2017 by m.dekeizer@argusi.org

I am trying to update the symbology of a layer using arcpy, but I get an error saying:

'Layer' object has no attribute 'symbology'

 

My (stripped) code is:

mySettings = GetSettings() #returns a pandas dataframe object
myProject = arcpy.mp.ArcGISProject(mySettings.loc["ArcGIS project"]["Value"])
myMap = myProject.listMaps("Layers")[0]
myTemplate = arcpy.mp.LayerFile(mySettings.loc["Template file"]["Value"]).listLayers()[0]
myMap.addLayer(myTemplate)
mySymbology = myTemplate.symbology

Can anyone tell me what is wrong with this code?

Outcomes