laptop and a wrench

Erro

Error setting symbol template for the GraduatedSymbolsRenderer class from ArcPy in ArcGIS Pro.

Última Publicação: November 21, 2019 ArcGIS Pro
Número de ID do Erro BUG-000125730
EnviadoOctober 3, 2019
Última ModificaçãoApril 28, 2025
Aplica-se àArcGIS Pro
Versão encontrada2.4.1
StatusWill Not Be Addressed

Informações Adicionais

After further investigation it was discovered that the layer being set from simple symbol to graduated colors did not have appropriate attributes to support this renderer. The same occurs in the UI and an error message appears stating the issue.

Solução Provisória

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)

Etapas para Reproduzir

ID do Erro: BUG-000125730

Software:

  • ArcGIS Pro

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download