Error
| Número de ID del error | BUG-000125730 |
|---|---|
| Enviado | October 3, 2019 |
| Última modificación | April 28, 2025 |
| Relacionado con | ArcGIS Pro |
| Versión encontrada | 2.4.1 |
| Estado | Will Not Be Addressed |
Add a layer file (template) that has the renderer set for the point FC, then change its data source to your correct point FC, update the classificationField to refresh the stats for the new layer and remove the original, replaced layer.
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Map')[0]
lyr1 = m.listLayers('SimplePtLayer')[0]
lyrFile = arcpy.mp.LayerFile(r"C:\Temp\GraduatedColors_Point.lyrx")
lyr2 = m.addLayer(lyrFile)[0]
lyr2.updateConnectionProperties(lyr2.connectionProperties, lyr1.connectionProperties)
sym = lyr2.symbology
sym.renderer.classificationField = 'Elevation' #resets field and stats
#Update symbol template - keep in mind lyrx could already have it.
symTemp = sym.renderer.symbolTemplate
symTemp.applySymbolFromGallery('Square 1')
sym.renderer.updateSymbolTemplate(symTemp)
#apply changes
lyr2.symbology = sym
#remove original layer
m.removeLayer(lyr1)
ID del error: BUG-000125730
Software:
Obtener ayuda de expertos en ArcGIS
Descargar la aplicación de soporte de Esri