AnsweredAssumed Answered

Attempting to use showLabels script within a model...

Question asked by mcdade31 on Feb 19, 2013
Latest reply on Feb 20, 2013 by mcdade31
I'm attempting to use a small script within my mxd (will later attach to a model) that will turn the labels on for a layer. My code is essentially straight from the Resource Center:

import arcpy mxd = arcpy.mapping.MapDocument(r"C:\path\to\my.mxd") for lyr in arcpy.mapping.ListLayers(mxd):   if lyr.description == "Layer Name":     lyr.showLabels = True del mxd arcpy.RefreshTOC() arcpy.RefreshActiveView()

I am running it with the mxd open from the python window. It looks like it is working because the map does refresh but the labels are not turning on.