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
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.