Updated Question! I'm attempting to find/create a python script that replicates the export tool to execute batch exports of featurelayers into specific shapefiles. I want each input featurelayer to be copied and overwritten to a respective output shapefile. I want each output to have a specific name. Using either the FeatureClasstoFeatureClass_conversion()
or CopyFeatures_management()
functions I can get one featurelayer to output and overwrite a shapefile in a different location. But how to do this for a list of shapefiles?
import arcpy
Mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.mapping.ListLayers(Mxd)
arcpy.env.overwriteOutput = True
sampleinputList = ["input_a", "input_b", "input_c"] #these are feature layers in the mxd
sampleout_path = "T:/path" #path I'll be batch outputting &overwriting these shapefiles to
samplenames = ["input_a_name", "input_b_name", "input_c_name"]
sampleOutputnamesList = ["T:/path/input_a_name", "T:/path/input_b_name", "T:/path/input_c_name"] # I want each input to correspond to a respective output name
for featureclasses in sampleinputList:
arcpy.CopyFeatures_management(sampleinputList,sampleOutputnamesList)
#or maybe this might work?
for featureclasses in sampleinputList:
arcpy.FeatureClasstoFeatureClass_conversion(sampleinputList,sampleout_path,samplenames)
both instances give me a
Runtime error
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 2281, in CopyFeatures
raise e
RuntimeError: Object: Error in executing tool