Advanced Label Expressions with ArcPy

10-20-2011 08:05 AM
Status: Open
Labels (1)
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. 


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


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!
this would be extremely helpful for us using arcpy
Perhaps moving to python for labels as well instead of VB as there is a general move away from VB in arcmap.
At 10.1 we added a new label expression parser for Python, so you can now build label expressions using Python.
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.
A workaround is to use "\x22"
The new label expression is not the same as the advanced checkbox.  the label expression can't contain return values and use conditional statements.