Consuming a geoprocessing custom model in .NET


Purpose
This sample shows how to consume a custom geoprocessing model in a .NET Visual Studio console project. This sample accompanies the Consuming a geoprocessing model tool in .NET walkthrough topic.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample.

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/AirportsAndGolf.
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.

Data preparation
  1. Create a directory on your local machine to copy the test data and files. For example, create gp under the C:\ drive in which case your files and data will be in C:\gp\AirportsAndGolf directory. You can, however, create the folder anywhere as the program prompts you to type the path in the command line.
  2. Copy the AirportsAndGolf folder from the <ArcGIS Developer Kit installation location>\Samples\data folder to the directory you created in Step 1. The following files show in the file view—golf.gdb (geodatabase), airportgolf.mxd (map document), Find Golf Courses.tbx (toolbox), and validateinput.py (Python file). See the following screen shot that shows the data and files on the local drive and in the Catalog tree:


  3. Screen shot showing data and files on the local drive and in the Catalog tree.

Test the .NET solution
  1. Open the solution file in the CSharp or VBNet folder for this sample.
  2. Compile and run the solution.
  3. On the console window, type the data's full path, then press Enter.

LicenseInitializer.vb Initializes the application to use ArcObjects.
Module1.vb The main code module that demonstrates consuming a geoprocessing custom model.
Download the VB.NET files
LicenseInitializer.cs Initializes the application to use ArcObjects.
Program.cs The main code module that demonstrates consuming a geoprocessing custom model.
Download the C# files

Download the files for all languages

See Also:

Walkthrough: Consuming a geoprocessing model tool in .NET




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