CopyFeatures and Geoprocessor changed after SDK 10.0?

3796
2
Jump to solution
09-27-2015 12:41 PM
OlaRennemo
New Contributor III

Hi all,

I have been using this simple C# code to copy featureclasses between geodatabases (ArcObjects SDK 10.0):

...

using ESRI.ArcGIS.DataManagementTools;

using ESRI.ArcGIS.Geoprocessor;

...

CopyFeatures cf = new CopyFeatures;

cf.in_features = "C:\\geodb1.mdb\\MyFeatureClass";

cf.out_feature_class = "C:\\geodb2.gdb\\MyFeatureClass";

Geoprocessor gp = new Geoprocessor();

gp.OverwriteOutput = true;

gp.AddOutputsToMap = false;

gp.Execute(cf,null);

...

After installing ArcObjects 10.3, "Geoprocessor.Execute()" is using other parameters, but somehow I cannot find any code examples or documentation dealing with this situation.

Any suggestions ?

-Ola

0 Kudos
1 Solution

Accepted Solutions
FreddieGibson
Occasional Contributor III

The signature for this class hasn't changed between the 10.x versions. I'd assume that the intellisense in Visual Studio is showing you the unmanaged signature for this assembly. The geoprocessor should provide you with the following signatures:

Geoprocessor.Execute(IGPProcess, ITrackCancel) // Managed

Geoprocessor.Execute(String, IVariantArray, ITrackCancel) // Unmanaged

All of the relevant information about running a managed or unmanaged tool should be available on the following page.

How to run a Geoprocessing tool

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000003rr000000

View solution in original post

2 Replies
FreddieGibson
Occasional Contributor III

The signature for this class hasn't changed between the 10.x versions. I'd assume that the intellisense in Visual Studio is showing you the unmanaged signature for this assembly. The geoprocessor should provide you with the following signatures:

Geoprocessor.Execute(IGPProcess, ITrackCancel) // Managed

Geoprocessor.Execute(String, IVariantArray, ITrackCancel) // Unmanaged

All of the relevant information about running a managed or unmanaged tool should be available on the following page.

How to run a Geoprocessing tool

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000003rr000000

OlaRennemo
New Contributor III

I see it now:

       

ESRI.ArcGIS.Geoprocessing.GeoProcessor gpUnManaged = new ESRI.ArcGIS.Geoprocessing.GeoProcessor();

gpUnManaged.Execute(name, params, trackCancel);

VS

       

ESRI.ArcGIS.Geoprocessor.Geoprocessor gpManaged = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();

gpManaged.Execute(tool,trackCancel);

Details, details...

Thanks a lot!

0 Kudos