How can I set the Language for a Label Class from Python? The code below works only if the language has been manually set to Python. I would like to be able to set the language from within the code.
Edit: Asked a different way, is there a way to determine what the current setting is for Language in the Label Class? With this information, the returned expression format can match the current Language setting.
aprx = arcpy.mp.ArcGISProject('CURRENT') m = aprx.listMaps() lyr = m.listLayers() if lyr.supports('SHOWLABELS'): lyr.listLabelClasses().expression = '\'<FNT name="Arial" size="8">\' + str([targetMap_STATEFP]) + \'</FNT>\'' lyr.listLabelClasses().visible = True m.listLayers().showLabels = True
Solved! Go to Solution.