laptop and a wrench

不具合

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

最後に公開された状態: November 21, 2019 ArcGIS Pro
不具合 ID 番号 BUG-000125730
送信されましたOctober 3, 2019
最終更新日April 28, 2025
適用対象ArcGIS Pro
見つかったバージョン2.4.1
ステータスWill Not Be Addressed

参考情報

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.

対処法

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: BUG-000125730

ソフトウェア:

  • ArcGIS Pro

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動