I have a shapefile called (AOI) with multiple AOI's and wanted to colour them by ID so that they were all different.
I used:
aprx = arcpy.mp.ArcGISProject('current')
m = aprx.activeMap
AOI = m.listLayers('AOI')[0]
sym = AOI.symbology
sym.updateRenderer('UniqueValueRenderer')
colorRamp = aprx.listColorRamps("Cyan to Purple")[0]
sym.renderer.colorRamp = colorRamp
AOI.symbology = sym
I have also tried doing this manually as well and the same problem occurs. They also do not re-appear when I change the symbology back to Single Symbol.
Any thoughts?