laptop and a wrench

Bogue

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

Dernière publication: June 24, 2015 ArcGIS for Desktop
Numéro d’ID de bogue BUG-000088225
EnvoiJune 9, 2015
Dernière modificationJune 5, 2024
S’applique àArcGIS for Desktop
Version trouvée10.3.1
StatutWill Not Be Addressed

Informations supplémentaires

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.

Solution de contournement

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

Étapes pour reproduire

ID de bogue: BUG-000088225

Logiciel:

  • ArcGIS for Desktop

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement