ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Mapping.Events Namespace / SketchModifiedEventArgs Class
Members Example

In This Topic
    SketchModifiedEventArgs Class
    In This Topic
    Provides information about the geometry when a sketch is modified.
    Object Model
    SketchModifiedEventArgs ClassGeometry ClassMapView ClassGeometry Class
    Syntax
    public sealed class SketchModifiedEventArgs : System.EventArgs 
    Public NotInheritable Class SketchModifiedEventArgs 
       Inherits System.EventArgs
    Example
    Listen to the sketch modified event
    // SketchModified event is fired by 
    //  - COTS construction tools (except annotation, dimension geometry types), 
    //  - Edit Vertices, Reshape, Align Features
    //  - 3rd party tools with FireSketchEvents = true
    
    
    //Subscribe the sketch modified event
    //ArcGIS.Desktop.Mapping.Events.SketchModifiedEvent.Subscribe(OnSketchModified);
    
    private void OnSketchModified(ArcGIS.Desktop.Mapping.Events.SketchModifiedEventArgs args)
    {
      // if not an undo operation
      if (!args.IsUndo)
      {
        // what was the sketch before the change?
        var prevSketch = args.PreviousSketch;
        // what is the current sketch?
        var currentSketch = args.CurrentSketch;
        if (currentSketch is Polyline polyline)
        {
          // Examine the current (last) vertex in the line sketch
          var lastSketchPoint = polyline.Points.Last();
    
          // do something with the last point
        }
      }
    }
    
    Inheritance Hierarchy

    System.Object
       System.EventArgs
          ArcGIS.Desktop.Mapping.Events.SketchModifiedEventArgs

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also