Adding Display Expression as a arcpy.mapping layer property

986
3
02-20-2014 04:17 PM
Status: Already Offered
Labels (1)
Emilbrundage
New Contributor III

I would like to see the ability to set a layer's display expression using arcpy. A big part of my job is creating KMZs, and setting a layer's display expression before converting to KMZ is vital. I have to do this manually since it is not currently supported with arcpy. This means producing KMZs is not scaleable to the degree that would suit my work best. Please consider this for future arcpy releases.

Thanks!

3 Comments
MikeHerrmann1
I meant to promote this but accidentally did the opposite (curse your irreversible voting process).  My boss just asked me to set set the display expressions for 20 files in 1000 mxds.  I thought, "this will by easy with arcpy." Well, it would have been easy if you could do it in ArcPy.  I hope there is a way to automate this, otherwise this supposedly simple task just ugly.
JasonVignochi2

I agree this really needs to happen. There are a few workarounds that I have found - building a template layer and then sourcing from that template or tricking the default display value - but adding this to the API would be a great help overall. Especially how often KMZs are converted out of Arc.

JeffBarrette
Status changed to: Already Offered

Accessing a Layer's display properties are not directly accessible via the curated arcpy.mp API but is accessible via Python CIM Access: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm

Here is a downloadable set of CIM script examples and one of them changes a layer's display properties.

https://www.arcgis.com/home/item.html?id=8772f61319584882bb697ba003030636

Jeff - Layout and arcpy.mp teams