Copy Features tool

997
8
01-18-2012 05:10 AM
SimonKettle
Occasional Contributor III
Hello,

Is it possible when using the copy features tool in model builder to copy the features over to the default geodatabase without the suffix "_CopyFeatures" being added to the resulting feature class?

Cheers,
0 Kudos
8 Replies
DanLee
by Esri Regular Contributor
Esri Regular Contributor
As long as a feature class with the same name in the geodatabase does not already exist, you can name the output any way you like. Otherwise, it will overwrite the existing data if you have chosen the Overwirte Output option for geoprocessing.
0 Kudos
SimonKettle
Occasional Contributor III
Thanks...but I am conducting a process where I have shapefiles that I am joining to a CSV table.

Then to make the join permanent I am using the copy tool. Whenever I do this it uses the orginal filename from the shapefile and adds "_CopyFeature" to it.
Within Model Builder I cannot see how to copy the shapefile to the geodatabase without the "_CopyFeature"
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
You should be able to open the Copy Features tool dialog inside ModelBuilder and change the automatically derived output name to anything you like, e.g. myResult, without the _CopyFeatures.
0 Kudos
by Anonymous User
Not applicable
As long as a feature class with the same name in the geodatabase does not already exist, you can name the output any way you like. Otherwise, it will overwrite the existing data if you have chosen the Overwirte Output option for geoprocessing.


Hi Dan,

I have a very simple model that uses the copy features tool.  Even though I have set my geoprocessing options to 'overwrite the output of geoprocessing operations', my model still keeps telling me that it cannot create the output because an object with that name already exists.  Also, if I run the same copy features tool outside model builder, it will run through and overwrite the output. 

I have a bunch of simple models that run basic geoprocessing tools.  They are all running fine, and overwriting existing output.

Any ideas why copy features will not work inside my simple model?
0 Kudos
ShitijMehta
Esri Regular Contributor
What version of ArcGIS are you working on?

Try validating a model before running the model, does that work?
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Katie,

I have checked with my colleague, Shitij, about Copy Features in MB; we are not aware of the behavior you described.

If you are still struggling with this issue, you can answer Shitij's questions so that we can follow up. Thanks.
0 Kudos
JustinShepard
Occasional Contributor II
I'm having a related issue using the CopyFeatures method in an addin. I have the Geoprocessor set to GP.OverwriteOutput = true; and it works (some of the time). The issue appears to be isolated to how geodatabases are being handled for the output feature class. I'm trying to capture the result so that I can work with it using IGeoProcessorResult2 result = (IGeoProcessorResult2)RunTool(GP, copyFeatures, null);

Scenario 1. Shapefiles: not a problem
Scenario 2. Geodatabase (personal or file, same issue):
Pass * if the feature class doesn't already exist then it gets created fine.
Pass * if the specifed output has the same path as an existing feature class then it overwrites it fine
Pass * if the output is specified to the root of the geodatabase and there is an existing feature class in a feature dataset then it runs fine
Failed * if the output is to a feature dataset and there is an existing feature class at the root or in another feature dataset then it fails (result = null)


Also, I have to remove any spaces in the output feature class name (again isolated to geodatabases, shapefiles work fine) or CopyFeatures fails. Spaces in the path (i.e. feature dataset name has a space) do not cause an error.

I'm running ArcGIS 10.
0 Kudos
ShitijMehta
Esri Regular Contributor
Hi,
We are sorry you are facing this problem. Unfortunately, this is an issue and has been logged into our system as a bug. For now you will have to modify your script to check for the existence of the feature class with same name and if it does then may be give it a unique name. You can try arcpy.CreateUniqueName if using Python or its equivalent for your addin.
0 Kudos