Advanced Label Expressions with ArcPy

1112
6
10-20-2011 08:05 AM
Status: Open
Labels (1)
johnhayes6
New Contributor II
Currently we are able to set a label expression with ArcPy by using the lblclass.expression method.  However, there is no way to check the "Advanced" box from ArcPy. 

0EM30000000CsoQ

There also doesn't appear to be a way to select with language parser is uesd (VBScript or JScript)

0EM30000000CsoV



It would be very helpful to have this capability.  In addition to this, being able to load precreated label expressions from ".lxp" files through ArcPy would be great. 

I would be extremely helpful if all of the settings in the label manager were exposed in ArcPy which include Label position, Fitting Strategy, and Conflict Resolution parameters.  All of this would fully enable complete automation over setting up labels for features.

Finally, it would be nice if the label engine (default or Maplex) could be set within a python script.

Thanks for considering!
6 Comments
FrankVignati
this would be extremely helpful for us using arcpy
ChrisMathers
Perhaps moving to python for labels as well instead of VB as there is a general move away from VB in arcmap.
ChrisFox
At 10.1 we added a new label expression parser for Python, so you can now build label expressions using Python.
RobertMartin2
Seems like the Python parser is a little buggy. For example, you can't escape double quotes with a backslash as you can in standard Python. When I do this none of my labels will draw.
curtvprice
A workaround is to use "\x22"
WilliamGreenwood1
The new label expression is not the same as the advanced checkbox.  the label expression can't contain return values and use conditional statements.