Select to view content in your preferred language

'CURRENT' invalid when using Arcpy in Layer Labeling Properties Python expression

276
1
06-05-2024 12:02 PM
gis_bCapell
New Contributor III

When attempting to use arcpy.mp.ArcGISProject('CURRENT') within a labeling properties class python expression a map drawing alert is generated although the expression is valid. I simplified the label logic to show just the key issue. This technical support FAQ page indicates that arcpy.mp.ArcGISProject('CURRENT') returns the OSError when ran in a standalone environment. I am trying to run this in the ArcGIS Pro labeling properties. This Arcpy documentation doesn't designate that labeling properties is outside of the application. Is labeling properties somehow considered a standalone environment, even though it appears to be within ArcGIS Pro? @ShareUser

gis_bCapell_0-1717614586260.png

 

 

1 Reply
DanPatterson
MVP Esteemed Contributor

I have only seen examples using the LabelClass within the mp module as in the examples here

LabelClass—ArcGIS Pro | Documentation

I don't know if arcpy used to create expressions in the environment you show is possible since it doesn't access a project directly


... sort of retired...
0 Kudos