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


ISnapEnvironment.SnapPoint Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Editor)  

ISnapEnvironment.SnapPoint Method

Attempts to snap the point using the current snap environment.

[Visual Basic .NET]
Public Function SnapPoint ( _
    ByVal point As IPoint _
) As Boolean
[C#]
public bool SnapPoint (
    IPoint point
);

Product Availability

Available with ArcGIS Desktop.

Description

SnapPoint passes the required point parameter to each of the added Snap Agents in the order that these agents were added. The agents attempt, in turn, to find point coordinates that fulfill its snap properties for the incoming point. If a new snap location is found, the relevant snap agent modifies the original point's coordinates to that of the new location. The same point is then returned to SnapPoint.  Once a snap agent is found that satisfies the point subsequent snap agents are not tested.


Remarks

As an example: there may be several FeatureSnap agents present. Each receives a point from the current cursor location, which is passed to the agent via the SnapPoint method. If the conditions for a snap are met, the boolean value of the agent returns TRUE, the point's coordinates are updated based on the active FeatureSnap's conditions and the same point is returned to SnapPoint. In the Editor, the InvertAgent location is always set equal to this point. Thus, when snapping conditions are met, the InvertAgent (blue dot) is passed the point with altered coordinates, and the corresponding location shift is manifested as a "snap".

See Also

ISnapEnvironment Interface