Executing tools


Purpose
This sample uses the IGeoprocessor object to perform a number of geoprocessing operations. This sample extracts features to a new feature class based on a location and an attribute query.

How to use

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/GP/ExecuteTools.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Copy the test data to C:\data folder.
  2. Start Visual Studio.
  3. Open the solution (*.sln) file.
  4. If your data is not in C:\data folder, change the hard-coded paths to data in the gp_copyfeatures.cpp file.
  5. Build the solution.
  6. Run the program (start debugging or press F5).
  7. Start ArcMap.
  8. Drag and drop the districts and contaminated_areas feature classes.
  9. The output shows only those contaminated sites that fall within the districts.

gp_copyfeatures.cpp Implementation file.
stdafx.cpp The precompiled implementation file for the sample.
stdafx.h The precompiled header files for the sample.
Download the VCPP files

Download the files for all languages




Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced