1

I have a shapefile which contains some features and I need to copy these features and paste them into an EXISTING feature class using ArcPy. I have tried the (arcpy.CopyFeatures_management(..)) but it seems it is used only to copy data from a shapefile to a NEW feature class.

import arcpy
input_ShapeFile ="C:\Users\Moh\Desktop\file.shp"
output_FeatureClass ="C:\Users\Moh\Desktop\Data.mdb\fc" 
arcpy.CopyFeatures_management(input_ShapeFile, output_FeatureClass)
...ERROR 000725: Output Feature Class: Dataset "C:\Users\Moh\Desktop\Data.mdb\fc"
 already exists. Failed to execute (CopyFeatures).

I am using ArcMap 10.5.

0
1

I think that both your paths need to be turned into raw strings:

input_ShapeFile = r"C:\Users\Moh\Desktop\file.shp"
output_FeatureClass = r"C:\Users\Moh\Desktop\Data.mdb\fc" 

and, as commented by @BERA, try using Append (instead of Copy Features) which:

Appends multiple input datasets into an existing target dataset. Input datasets can be feature classes, tables, shapefiles, rasters, annotation or dimensions feature classes.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.