How to use
See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. 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.
Automating an ArcGIS for Desktop application
- Open the solution file in Visual Studio and compile the sample.
- Run DesktopAutomationCS.exe or DesktopAutomationVB.exe depending on the language version.
- Select ArcMap, ArcScene, or ArcGlobe from the application drop-down list and click Start to start a new application session. Notice the change in the state of the Start (becomes unavailable) and the Exit (becomes available) buttons.
- Type the path of a valid shapefile in the text box, and click Add Layer to add it to the new application session.
- Click Exit to shut down the application session. Notice the change in the state of the Start (becomes available) and the Exit (becomes unavailable) buttons.
Handling modal dialog boxes when exiting the application
- Start a new application session.
- Open a modal dialog box of the application; for example, click the Add Data button.
- With the Add Data dialog box displayed, click Exit to shut down the application session.
Handling the manual application shutdown in an automation session
- Start a new application session.
- Close the application manually by clicking File, then clicking Exit or click the Close (X) button on the title bar. Notice the change in the state of the Start (becomes available) and the Exit (becomes unavailable) buttons.
Form1.cs | Form for automation demonstration showing how to start an ArcGIS for Desktop application. |
Form1.vb | Form for automation demonstration showing how to start an ArcGIS for Desktop application. |
Download the files for all languages
See Also:
Automating ArcGIS for Desktop applicationsDevelopment 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 |