Manage snap agents

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

How to use

See How to use ArcGIS samples for help on running the sample.

  1. Start the sample application. The ushigh.shp shapefile from the sample data is loaded into the Map control.
  2. Start an edit session using the Editor menu on the toolbar.
  3. Click the Snapping Dialog command to start the Snapping Dialog.
  4. Use the controls on the Snapping Dialog to modify the snapping environment. The changes made by the Snapping Dialog are reflected in the Snapping control on the Editor menu.

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

editing/ Entry point for the sample. It initializes the interop, sets up the user interface (UI), and ensures licensing is valid.
editing/ Represents the dialog used to manage snap agents. Contains the code to build the UI and respond to user actions.
editing/ Contains the code to implement a custom command. The command displays the SnappingDialog.
editing/ Represents the model used by the JTable on the SnappingDialog. Contains the code to implement the actions defined on the SnappingDialog. The SnappingDialog delegates to this class for all actions.

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