mxd = arcpy.mapping.MapDocument("Current") df = arcpy.mapping.ListDataFrames(mxd)[0] TOCLayerList = arcpy.mapping.ListLayers(mxd, "*", df) SelectedLayerList = [] for lyr in TOCLayerList: lyrExtent = lyr.getExtent() lyrSelectedExtent = lyr.getSelectedExtent() if not lyrExtent == lyrSelectedExtent: SelectedLayerList.append(lyr) print SelectedLayerList
import pythonaddins mxd = arcpy.mapping.MapDocument("current") lyr = pythonaddins.GetSelectedTOCLayerOrDataFrame() print lyr.name
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.