laptop and a wrench

Bug

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

Zuletzt veröffentlicht: June 24, 2015 ArcGIS for Desktop
Bug-ID-Nummer BUG-000088225
EingereichtJune 9, 2015
Zuletzt geändertJune 5, 2024
Gilt fürArcGIS for Desktop
Gefunden in Version10.3.1
StatusWill Not Be Addressed

Zusätzliche Informationen

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.

Workaround

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>" '''

Schritte zur Reproduzierung

Bug-ID: BUG-000088225

Software:

  • ArcGIS for Desktop

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln