4 Replies Latest reply on Aug 16, 2015 12:09 AM by kuwaitndthl

    Turn layers off w/ arcpy.mapping

      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?


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