laptop and a wrench

不具合

The ArcPy layer.labelClasses.expression method does not accept properly formatted strings if they contain multiple quotation marks.

最後に公開された状態: June 24, 2015 ArcGIS for Desktop
不具合 ID 番号 BUG-000088225
送信されましたJune 9, 2015
最終更新日June 5, 2024
適用対象ArcGIS for Desktop
見つかったバージョン10.3.1
ステータスWill Not Be Addressed

参考情報

This is a known behavior. The additional quotes are needed to make sure the Python window reads the field 'FID' and not a variable in a list.

対処法

The additional quotes are needed to properly form the string to be set as the expression. Without them it will not read 'FID' as a field. Instead, the method inteprates as the user is trying to use a variable in a list, because that is what that means in a Python interpreter. In the expression dialog, it does not expect the additional quotes because the Python parser understands that the brackets around a word indicate a field. Use triple quotes around the expression to maintain the full string: layer.labelClasses[0].expression = ''' "<CLR red='255'><FNT size = '17'>" + [OBJECTID] + "</FNT></CLR>" '''

再現の手順

不具合 ID: BUG-000088225

ソフトウェア:

  • ArcGIS for Desktop

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

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

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

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

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

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

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