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?
symbology is readonly Layer—Help | ArcGIS Desktop
it can be set in arcmap Layer—Help | ArcGIS Desktop
in PRO Layer—ArcPy | ArcGIS Desktop symbology is read and write...
the symbology gives code examples Symbology—ArcPy | ArcGIS Desktop
I'm sorry, I can't figure out what you mean by this answer. Symbology is read and write in Pro? But why can't I access it then?
No clue... I am just the messenger. Did you check the code example at the bottom of the last link or did you stop part way through?
It turns out I had the wrong version of ArcGIS Pro installed. With updating everything is fixed. Thanx for the feedback.