ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Editing Namespace / EditOperation Class / Transform Method / Transform(Layer,TransformMethod) Method
The layer to transform.
The transformation method to use.
Example

In This Topic
    Transform(Layer,TransformMethod) Method
    In This Topic
    Transform a layer.
    Syntax
    public void Transform( 
       Layer layer,
       TransformMethod transformMethod
    )
    Public Overloads Sub Transform( _
       ByVal layer As Layer, _
       ByVal transformMethod As TransformMethod _
    ) 

    Parameters

    layer
    The layer to transform.
    transformMethod
    The transformation method to use.
    Exceptions
    ExceptionDescription
    Transformation method cannot be null
    Invalid transformation method
    Example
    Edit Operation Transform Features
    var transformFeatures = new EditOperation() { Name = "Transform Features" };
    
    //Transform a selected set of features
    //At 2.x - var transformSelection = MapView.Active.GetFeatures(polygon).Select(
    //    k => new KeyValuePair<MapMember, List<long>>(k.Key as MapMember, k.Value));
    //transformFeatures.Transform(transformSelection, linkLayer);
    ////Transform just a layer
    //transformFeatures.Transform(featureLayer, linkLayer);
    ////Perform an affine transformation
    //transformFeatures.TransformAffine(featureLayer, linkLayer);
    
    var affine_transform = new TransformByLinkLayer()
    {
      LinkLayer = linkLayer,
      TransformType = TransformMethodType.Affine //TransformMethodType.Similarity
    };
    //Transform a selected set of features
    transformFeatures.Transform(MapView.Active.GetFeatures(polygon), affine_transform);
    //Perform an affine transformation
    transformFeatures.Transform(featureLayer, affine_transform);
    
    //Execute to execute the operation
    //Must be called within QueuedTask.Run
    if (!transformFeatures.IsEmpty)
    {
      var result = transformFeatures.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
    }
    
    //or use async flavor
    //await transformFeatures.ExecuteAsync();
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also