Hello,
I am trying to give features labels with python code.
Here is the code I am using:
and I get this error:
Runtime error <type 'exceptions.NameError'>: name 'lblclass' is not defined
I thought this worked once, but not anymore..
Do I have to define "lblclass"??
If you could give me some help, I'd really appreciate it, thanks!
I am trying to give features labels with python code.
Here is the code I am using:
Code:
>>> import arcpy
... mxd = arcpy.mapping.MapDocument("CURRENT")
... layer = arcpy.mapping.ListLayers(mxd, "")[0]
... if layer.supports("LABELCLASSES"):
... for lblclass in layer.labelClasses:
... lblclass.showClassLabels = True
... lblclass.expression = "[type]"
... layer.showLabels = True
... arcpy.RefreshActiveView()
...
Runtime error <type 'exceptions.NameError'>: name 'lblclass' is not defined
I thought this worked once, but not anymore..
Do I have to define "lblclass"??
If you could give me some help, I'd really appreciate it, thanks!