sarbajit

How to select layer from table of contents programmatically?

Discussion created by sarbajit on Aug 20, 2012
Latest reply on Aug 23, 2012 by sarbajit
I need to select second layer from table of contents of an active data frame and then export that layer to a new feature class.

import arcpy

# Point to current map document
mxd = arcpy.mapping.MapDocument("CURRENT")

# Now how do I select the second layer from table of contents of current map document?

# Once I figure that out I can then export the layer by using "arcpy.CopyFeatures_management()"


Please help.

Outcomes