ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Snapping Class / GetSnapMode Method
Example

In This Topic
    GetSnapMode Method (Snapping)
    In This Topic
    Gets the state of a single SnapMode.
    Syntax
    public static bool GetSnapMode( 
       SnapMode mode
    )
    Public Shared Function GetSnapMode( _
       ByVal mode As SnapMode _
    ) As Boolean

    Parameters

    mode
    Example
    Configure Snapping - Application SnapModes
    // set only Point and Edge snapping modes, clear everything else
    //At 2.x - ArcGIS.Desktop.Mapping.Snapping.SetSnapModes(SnapMode.Point, SnapMode.Edge);
    ArcGIS.Desktop.Mapping.Snapping.SetSnapModes(
      new List<SnapMode>() { SnapMode.Point, SnapMode.Edge });
    
    // clear all snap modes
    //At 2.x - ArcGIS.Desktop.Mapping.Snapping.SetSnapModes();
    ArcGIS.Desktop.Mapping.Snapping.SetSnapModes(null);
    
    
    // set snap modes one at a time
    ArcGIS.Desktop.Mapping.Snapping.SetSnapMode(SnapMode.Edge, true);
    ArcGIS.Desktop.Mapping.Snapping.SetSnapMode(SnapMode.End, true);
    ArcGIS.Desktop.Mapping.Snapping.SetSnapMode(SnapMode.Intersection, true);
    
    // get current snap modes
    var snapModes = ArcGIS.Desktop.Mapping.Snapping.SnapModes;
    
    // get state of a specific snap mode
    bool isOn = ArcGIS.Desktop.Mapping.Snapping.GetSnapMode(SnapMode.Vertex);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also