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


IGraphicSnap Interface (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Carto)  

IGraphicSnap Interface

Provides access to members that control snapping graphics.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Read-only property Name The name of the snap agent.
Method SnapX Indicates if the point is snapped in the horizontal direction.
Method SnapY Indicates if the point is snapped in the vertical direction.

CoClasses that implement IGraphicSnap

CoClasses and Classes Description
GridSnap Snap to grid agent.
GuideSnap Snap to guides agent.
MarginSnap Snap to margins agent.
RulerSnap Snap to ruler agent.

Remarks

The graphic snap is used to create snap agents that snaps graphics to the grid, guides, margins and rulers of the page layout.

There are three different types of graphic snaps: the guide snap moves graphics to the horizontal and vertical guides. The margin snap snaps graphics to the layouts printable bounds. The ruler snap snaps graphics to the rulers. They all implement the IGraphicSnap interface.

Name is the name of the snap agent.

SnapX and SnapY are unique and are used to determine if a graphic can be snapped. For example, the GridSnap agent�s implementation of SnapX for polygon graphics checks if either the Xmin or Xmax of the graphics bounding rectangle is within snap tolerance of the snap grid. If either is, the graphic is moved the calculated distance between the two. SnapX and SnapY always return a Boolean, indicating whether or not the graphic was snapped. If any snap agent returns True, no other snap agents are called.

See also IPageLayoutSnap.