AnsweredAssumed Answered

Layer Label Toggle

Question asked by vshah6 on Mar 3, 2017
Latest reply on Mar 7, 2017 by cpotts_extenetsystems

I am trying to write a python script for a tool that lets you toggle the labels for specific feature classes using Boolean values. My question is how can I get the labels to turn on or off? I've seen examples of people using the variable.showLabels = True to get their labels to display but for me it did not work. Any help is greatly appreciated.

if (turnLabelsOnOff == True) and (layer in layerList):
    layer.showLabels = True

if (turnLabelsOnOff == False) and (layer in layerList):
    layer.showLabels = False

if (turnLabelsOnOff == True) and (layer in layerList):
    layer.showLabels = True

if (turnLabelsOnOff == False) and (layer in layerList):
    layer.showLabels = False

Outcomes