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


IEngineSnapEnvironment.SnapPoint Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Controls)  

IEngineSnapEnvironment.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
);
[C++]
HRESULT SnapPoint(
  IPoint* point,
  VARIANT_BOOL* snapped
);
[C++]

Parameters point [in]
point is a parameter of type IPoint snapped [out, retval] snapped is a parameter of type VARIANT_BOOL

Product Availability

Available with ArcGIS Engine.

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.

As an example: there may be several feature snap 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 feature snap conditions and the same point is returned to SnapPoint.

See Also

IEngineSnapEnvironment Interface