Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Get Currently Selected Layer in ArcMap Table of Contents

$
0
0
I am developing a Python plugin that needs to get information about the currently selected layer in the ArcMap table of contents. I've looked through the arcpy.mapping module for an appropriate function and searched the internet but to no avail. Is there a way to get the name (or index) of the currently selected layer using arcpy? With either piece of information, I could then use arcpy.mapping.ListLayers() to get the appropriate layer object. In the sample below, I would like the python script to get either u'Nodes' (name) or 0 (index) from the selected layer.

Attachment 31347

Thanks for your help,

-Dave

ArcGIS 10.1 SP1
Attached Thumbnails
Click image for larger version

Name:	sample.jpg‎
Views:	N/A
Size:	47.1 KB
ID:	31347  

Viewing all articles
Browse latest Browse all 2485

Trending Articles