ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Editing Namespace / EditOperation Class / Rotate Method / Rotate(SelectionSet,MapPoint,Double) Method
A set of features to rotate
The origin around which the geometry will be rotated.
The rotation angle in radians
Example

In This Topic
    Rotate(SelectionSet,MapPoint,Double) Method
    In This Topic
    Rotates a set of features.
    Syntax
    public void Rotate( 
       SelectionSet features,
       MapPoint origin,
       double angle
    )
    Public Overloads Sub Rotate( _
       ByVal features As SelectionSet, _
       ByVal origin As MapPoint, _
       ByVal angle As Double _
    ) 

    Parameters

    features
    A set of features to rotate
    origin
    The origin around which the geometry will be rotated.
    angle
    The rotation angle in radians
    Example
    Edit Operation Rotate Features
    var rotateFeatures = new EditOperation() { Name = "Rotate Features" };
    
    //Rotate works on a selected set of features
    //Get all features that intersect a polygon
    
    //at 2.x - var rotateSelection = MapView.Active.GetFeatures(polygon).Select(
    //    k => new KeyValuePair<MapMember, List<long>>(k.Key as MapMember, k.Value));
    //rotateFeatures.Rotate(rotateSelection, origin, Math.PI / 2);
    
    //Rotate selected features 90 deg about "origin"
    rotateFeatures.Rotate(MapView.Active.GetFeatures(polygon), origin, Math.PI / 2);
    
    //Execute to execute the operation
    //Must be called within QueuedTask.Run
    if (!rotateFeatures.IsEmpty)
    {
      var result = rotateFeatures.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
    }
    
    //or use async flavor
    //await rotateFeatures.ExecuteAsync();
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also