laptop and a wrench

不具合

The Calculate Field tool results in a NameError exception when using Python variables.

最後に公開された状態: October 28, 2015 ArcGIS for Desktop
不具合 ID 番号 BUG-000091442
送信されましたOctober 15, 2015
最終更新日June 5, 2024
適用対象ArcGIS for Desktop
見つかったバージョン10.2.2
オペレーティング システムWindows OS
オペレーティング システムのバージョン7.0 64 Bit
ステータスKnown Limit

参考情報

Changes were made around 10.2.2 to properly isolate script tool code, validation and tool like Calculate Field and Calculate Value that use Python internally. Prior to this change, there was potential for confusing and unexpected issues that would be hard to isolate because a variable could be changed in one tool that would impact another tool. The best strategy for passing variables into CalculateField is using string formatting as shown in the workaround.

対処法

Use the following code:arcpy.CalculateField_management(table,"gayu", "({0} + 1) / 2".format(funcg), "PYTHON", "")

再現の手順

不具合 ID: BUG-000091442

ソフトウェア:

  • ArcGIS for Desktop

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

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

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

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

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

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

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