Select to view content in your preferred language

Label Expression Parser

961
3
Jump to solution
05-14-2020 01:45 PM
ChrisHolmes
Frequent Contributor

Is there any way to determine using arcpy what the parser is set to? I'm guessing no and that it's more of a arc objects thing.

Thanks

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

Correct, for ArcMap.  You can infer it from the expression, e.g., the expression starting with 'def' means it is Python, but there is no ArcPy method or property for retrieving the Parser directly.

View solution in original post

3 Replies
JoshuaBixby
MVP Esteemed Contributor

Correct, for ArcMap.  You can infer it from the expression, e.g., the expression starting with 'def' means it is Python, but there is no ArcPy method or property for retrieving the Parser directly.

ChrisHolmes
Frequent Contributor

I can work with that. Our older mxd’s tend to be vbscript but we’ve used python over the last few years++. I can now tell which is being used and move forward accordingly.

Thanks Joshua

0 Kudos
MarcoBoeringa
MVP Regular Contributor

You can't do this in ArcMap using Python, but I am pretty sure you can in ArcGIS Pro using the new Python CIM access.

It will take a bit of time though to figure out exactly where in the JSON object model the information is, and you can then use arcpy.mp and the getDefinition() method on a layer object to access it.