This document is archived and information here might be outdated.  Recommended version.


ISnapAgent Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Editor > ESRI.ArcGIS.Editor > Interfaces > IS > ISnapAgent Interface
ArcGIS Developer Help

ISnapAgent Interface

Provides access to members that snap point locations using a tolerance.

Product Availability

Available with ArcGIS Desktop.

When To Use

The ISnapAgent interface is typically used in two scenarios: creating new custom snap agents and accessing properties of an existing snap agent. Implement this interface when creating a custom snap agent.

Members

Name Description
Read-only property Name The name of the snap agent shown in the UI.
Method Snap Called by the editor to perform the actual snapping logic.

Classes that implement ISnapAgent

Classes Description
CenterlinesSnap (esriArcScan) Snap agent that snaps to the centerlines of a raster.
CornerSnap (esriArcScan) Snap agent that snaps to the corners of a raster.
EndsSnap (esriArcScan) Snap agent that snaps to the ends of a raster.
FeatureSnap Snap agent that snaps to a feature in a specified way.
IntersectionSnap (esriArcScan) Snap agent that snaps to the intersections of a raster.
SolidSnap (esriArcScan) Snap agent that snaps to the solids of a raster.

Remarks

All snap agents implement this interface.

Tools that work with snapping typically call the ISnapEnvironment::SnapPoint method every time the mouse moves. SnapPoint in turn calls each snap agents Snap method in succession until one of them returns true. True means a new point has been found that meets the qualifications set within a particular snap agents snap method. For example, is the passed in point representing the Sketch tools current location, within 10 meters of a Parcel vertex. The first snap agent to return true, modifies the passed in points x,y location to reflect that of the new snap point location and no other snap agents are called.

Create custom snap agents by implementing this interface and register it in the ESRI Snap Agents component category. All snap agents registered in this component category will show up in the Snapping Window. All snap agents should additionally implement IPersistVariant (VB) or IPersistStream(C++). Implementing either IPersistVariant or IPersistStream enables snap agents to persist their state in a map document. These interfaces also have an important role with regards to the editor's snapping window, their implementation helps turn snap agents off and on.

See Also

ISnapEnvironment Interface | IGeometry Interface