for lyr in lyrList: return lyr.visible
import arcpy def IsLayerReallyVisible(mxd, layer): lyrNameList = layer.longName.split("\\") for lyrName in lyrNameList: lyr = arcpy.mapping.ListLayers(mxd, lyrName)[0] if not lyr.visible: return False return True mxd = arcpy.mapping.MapDocument("current") lyr = arcpy.mapping.ListLayers(mxd, "US_States")[0] print IsLayerReallyVisible(mxd, lyr)
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.