ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMGeoFeatureLayerBase Class / Snappable Property
Example

In This Topic
    Snappable Property (CIMGeoFeatureLayerBase)
    In This Topic
    Gets or sets a value indicating whether this layer participates in snapping in the editor.
    Syntax
    public bool Snappable {get; set;}
    Public Property Snappable As Boolean
    Example
    Configure Snapping - Layer Snappability
    // is the layer snappable?
    bool isSnappable = fLayer.IsSnappable;
    
    // set snappability for a specific layer - needs to run on the MCT
    await QueuedTask.Run(() =>
    {
      // use an extension method
      fLayer.SetSnappable(true);
    
      // or use the CIM directly
      //var layerDef = fLayer.GetDefinition() as ArcGIS.Core.CIM.CIMGeoFeatureLayerBase;
      //layerDef.Snappable = true;
      //fLayer.SetDefinition(layerDef);
    });
    
    
    // turn all layers snappability off
    layerList = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>();
    await QueuedTask.Run(() =>
    {
      foreach (var layer in layerList)
      {
        layer.SetSnappable(false);
      }
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also