tlowe

Turn layers off w/ arcpy.mapping

Discussion created by tlowe on Nov 11, 2010
Latest reply on Aug 16, 2015 by kuwaitndthl
Hey Folks,

I hope y'all can help me get a handle on using arcpy.mapping.  When I run the 4 lines below in the python window, the layers in the project are displayed.  But if I uncomment "lyr.visible = False" , nothing happens - I had hoped the layer would be turned off.  How would I code turning the layer off?

Thanks,
-Tripp

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
for lyr in arcpy.mapping.ListLayers(mxd):
    print lyr.name
#    lyr.visible = False

Outcomes