Hi all, i'm trying to set a label constraint to only label only those features that are not assigned to 999. So far my code doesn't work but I've tried the following below:
import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
qry = "facilityNumber <> '999'"
for map in aprx.listMaps():
for lyr in map.listLayers():
if lyr.supports("SHOWLABELS"):
if lyr.showLabels == qry:
print("Layer name: " + lyr.name)
for lblClass in lyr.listLabelClasses():
print("\t Class Name: \t" + lblClass.name)
print("\t Expression: \t" + lblClass.expression)
print("\t SQL Query: \t" + lblClass.SQLQuery)
del aprx