laptop and a wrench

不具合

Unable to set the ObjectID field as invisible and change the alias name of a field in the attribute table of a feature class using the Python Cartographic Information Model (CIM) code with an SQL Server database from ArcGIS Pro.

ArcGIS Pro
不具合 ID 番号 BUG-000155637
送信されましたFebruary 6, 2023
最終更新日June 5, 2024
適用対象ArcGIS Pro
見つかったバージョン2.9
オペレーティング システムWindows OS
オペレーティング システムのバージョンN/A
ステータスAs Designed

参考情報

The CIM often only persist changes made to an element in a project (to reduce the amount of bloat that would otherwise need to be persisted). In the case with field descriptions, the newly added data does not have any changes, therefore, nothing is persisted in the CIM. As a workaround, faking an alteration of a field in a feature or table can result in the information being persisted in the CIM. The following code uses arcpy.AlterField (but simply keeps the field info the same). First, it reports zero field descriptions for a feature class and a table, makes the modifications, then reports the field description counts. p = arcpy.mp.ArcGISProject('current') m = p.listMaps()[0] lyr = m.listLayers('NE_State_Boundaries')[0] tab = m.listTables('CensusData')[0] #Try returning cim field defs - NOPE lyr_cim = lyr.getDefinition('V3') print(f'LYR desc count PRE mod: {len(lyr_cim.featureTable.fieldDescriptions)}') tab_cim = tab.getDefinition('V3') print(f'TAB desc count PRE mod: {len(tab_cim.fieldDescriptions)}') #Modify fields lyrFld = arcpy.ListFields(lyr)[0] arcpy.management.AlterField(lyr, lyrFld.name, lyrFld.name, lyrFld.name) tabFld = arcpy.ListFields(tab)[0] arcpy.management.AlterField(tab, tabFld.name, tabFld.name, tabFld.name) #Try again lyr_cim = lyr.getDefinition('V3') print(f'LYR desc count POST mod: {len(lyr_cim.featureTable.fieldDescriptions)}') tab_cim = tab.getDefinition('V3') print(f'TAB desc count POST mod: {len(tab_cim.fieldDescriptions)}')

対処法

In ArcGIS Pro, manually change the alias name of the field and run the code.

再現の手順

不具合 ID: BUG-000155637

ソフトウェア:

  • ArcGIS Pro

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

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

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

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

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

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

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