I can't seem to find a tool in ArcMap 10.2.2 standard that allows you to export all the layers in my TOC to a directory
with each shapefile file name per layer in the TOC. I have a template geodatabase that I loaded shape file data into, then edited that data. Now I need to export some 100 plus layers from the geodatabase as shape files to update the original data.
Because of that, I'm looking for a Python sample that exports all the layers in my TOC to a file location or a function that selects the current geodatabase and exports all the features to shape files. Do you just copy and paste Python code to run it?
Is this something that can be none if I've never used Python before. I didn't see a lot of help for it, but I might of been looking in the wrong location. I looked around for a VBA macro editor as well and could located that. I might have a chance with that.
Thank you
John
This may get you started:
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
outputDir = r'path to output folder location to store .shp'
for x in arcpy.mapping.ListLayers(mxd):
desc = arcpy.Describe(x)
path = desc.catalogPath
arcpy.FeatureClassToShapefile_conversion (path, outputDir)
Mitch.
Thank you. I’ll see if I can get this to work. Still want to know what it’s doing, that might take longer.
John
Mitch's script is pretty straight forward and reading it should give you an idea of what it is doing. This is meant to run in the python window if you are in the map document (.mxd). This is not a standalone python script. just fyi.
Rebecca,
This is like the old days modifying LISP routine. Just try it.
Or for those of us that are long time ArcINFO workstation users... AML.