Managing snap agents


PurposeThis sample demonstrates how to programmatically add, remove, and turn on  IEngineSnapAgent and IEngineFeatureSnapAgent. These changes are made to  IEngineSnapEnvironment and reflected on the Editor's Snap Settings dialog box and the custom Snap Editor form supplied with this sample.

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/USAMajorHighways/usa_major_highways.
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. Build the solution and start the application.
  2. Start editing.
  3. Click the Snap Settings command to open the Snap Editor form.
  4. Use the controls on the Snap Editor form to edit IEngineSnapEnvironment. The IEngineSnapEnvironment settings, shown on the Snap Editor form are reflected on the Snap Settings dialog box.

Application/EditingForm.cs The main form, which contains a Map control and basic editing tools.
Core/SnapSettingsCommand.cs The command that launches the Snap Editor form.
Core/SnapEditorForm.cs Shows the snap agents and tolerance set in IEngineSnapEnvironment.
Download the C# files
Application/EditingForm.vb The main form, which contains a Map control and basic editing tools.
Core/SnapSettingsCommand.vb The command that launches the Snap Editor form.
Core/SnapEditorForm.vb Shows the snap agents and tolerance set in IEngineSnapEnvironment.
Download the VB.NET files

Download the files for all languages




Additional Requirements
  • An active edit session

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