I'm trying to set a label expression to a field ("StateWellNumber") in my table. I have the following code but I get an error message saying "name 'StateWellNumber' is not defined".
Any ideas?
Jon Mulder
Any ideas?
Jon Mulder
Code:
LayerFileLocation = "H:\Documents\GIS\HydstraData"
LayerName = "WellPoints.lyr"
##Show labels for WellPoints.
arcpy.mapping.Layer(os.path.join(LayerFileLocation,LayerName)).supports("LABELCLASSES")
arcpy.mapping.Layer(os.path.join(LayerFileLocation,LayerName)).showLabels = True
arcpy.mapping.Layer(os.path.join(LayerFileLocation,LayerName)).labelClasses.expression = [StateWellNumber]