ArcObjects Library Reference (Controls)  

IPointSnapper.Snap Method

Attempts to snap the specified point. This is used for tool snapping.

[Visual Basic .NET]
Public Function Snap ( _
    ByVal point As IPoint _
) As ISnappingResult
[C#]
public ISnappingResult Snap (
    IPoint point
);
[C++]
HRESULT Snap(
  IPoint* point,
  ISnappingResult** snappingResult
);
[C++]

Parameters

point [in]

  point is a parameter of type IPoint

snappingResult [out, retval]

  snappingResult is a parameter of type ISnappingResult

Product Availability

Available with ArcGIS Engine.

Remarks

Snap is the mechanism by which a test point (usually the cursor location) is evaluated against the snapping environment to determine whether any of the snapping criteria have been met.  This information is returned in the form of a snap result.  If the snapping criteria are not met, a null snap result is returned.  If a valid snap location was determined, the snap result defines the snap location along with information about which snapping type was satisfied.


Evaluating Snap candidates
The snapping environment honors the following layer settings:


Only features which match the criteria specified by these settings are evaluated against the snap candidate.
In addition, only those snapping types specified on the snapping environment are evaluated.  These are evaluated in a specific order.  This snapping type order is fixed.  It is important to note that layer order is secondary when a snap candidate is considered. This means that the point snapping type is evaluated against all layers before any subsequent snapping types are enabled.  The closest snap result for a given snapping type is always returned, regardless if other valid snap results were identified. 

 

Snapping Type Priority

  1. Point
  2. Intersection
  3. Endpoint
  4. Vertex
  5. Midpoint
  6. Tangent
  7. Edge


See Also

IPointSnapper Interface

.NET Samples

Angle Angle shape constructor (Code Files: AngleAngleCstr)