ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing Namespace / EditOperation Class / Split Method / Split(Layer,IEnumerable<Int64>,SplitMethod) Method
The layer of the features to split.
The oids of the features to split.
The method used to perform each split.
Example

In This Topic
    Split(Layer,IEnumerable<Int64>,SplitMethod) Method
    In This Topic
    Split features using a specified split method.
    Syntax
    Public Overloads Sub Split( _
       ByVal layer As Layer, _
       ByVal oids As IEnumerable(Of Long), _
       ByVal splitMethod As SplitMethod _
    ) 

    Parameters

    layer
    The layer of the features to split.
    oids
    The oids of the features to split.
    splitMethod
    The method used to perform each split.
    Exceptions
    ExceptionDescription
    Layer cannot be null. Split method cannot be null
    Only polyline layers can be split and split geometries cannot be null.
    Example
    Edit Operation Split Features
    // Splits the specified feature at the given points.
    await QueuedTask.Run(() =>
      {
        //Split features at given points
        //Split features using EditOperation.Split overloads
        var splitFeatures = new EditOperation() { Name = "Split Features" };
    
        //Split the feature at given points
        splitFeatures.Split(featureLayer, objectId, splitPoints);
    
        //Execute to execute the operation
        //Must be called within QueuedTask.Run
        if (!splitFeatures.IsEmpty)
        {
          //Execute and ExecuteAsync will return true if the operation was successful and false if not
          var result = splitFeatures.Execute();
          //or use async flavor
          //await splitAtPointsFeatures.ExecuteAsync();
        }
      });
    // Splits a feature in the specified feature layer based on a given percentage and object ID.
    await QueuedTask.Run(() =>
    {
      var percentage = 25.0;
    
      //Split features using EditOperation.Split overloads
      var splitFeatures = new EditOperation() { Name = "Split Features" };
    
      // split using percentage
      var splitByPercentage = new SplitByPercentage() { Percentage = percentage, SplitFromStartPoint = true };
      splitFeatures.Split(featureLayer, objectId, splitByPercentage);
    
      //Execute to execute the operation
      //Must be called within QueuedTask.Run
      if (!splitFeatures.IsEmpty)
      {
        //Execute and ExecuteAsync will return true if the operation was successful and false if not
        var result = splitFeatures.Execute();
        //or use async flavor
        //await splitAtPointsFeatures.ExecuteAsync();
      }
    });
    // Splits a feature in the specified feature layer into the specified number of parts.
    await QueuedTask.Run(() =>
      {
        var numParts = 3;
        // split using equal parts
        //Split features using EditOperation.Split overloads
        var splitFeatures = new EditOperation() { Name = "Split Features" };
        var splitByEqualParts = new SplitByEqualParts() { NumParts = numParts };
        splitFeatures.Split(featureLayer, objectId, splitByEqualParts);
    
        //Execute to execute the operation
        //Must be called within QueuedTask.Run
        if (!splitFeatures.IsEmpty)
        {
          //Execute and ExecuteAsync will return true if the operation was successful and false if not
          var result = splitFeatures.Execute();
          //or use async flavor
          //await splitAtPointsFeatures.ExecuteAsync();
        }
      });
    // Splits a feature in the specified feature layer at a given distance and object ID.
    await QueuedTask.Run(() =>
      {
        var distance = 150.0;
    
        //Split features using EditOperation.Split overloads
        var splitFeatures = new EditOperation() { Name = "Split Features" };
    
        // split using single distance
        var splitByDistance = new SplitByDistance() { Distance = distance, SplitFromStartPoint = false };
        splitFeatures.Split(featureLayer, objectId, splitByDistance);
    
        //Execute to execute the operation
        //Must be called within QueuedTask.Run
        if (!splitFeatures.IsEmpty)
        {
          //Execute and ExecuteAsync will return true if the operation was successful and false if not
          var result = splitFeatures.Execute();
          //or use async flavor
          //await splitAtPointsFeatures.ExecuteAsync();
        }
    
      });
    // Splits a feature in the specified feature layer at a given distance and object ID.
    await QueuedTask.Run(() =>
     {
       var distances = new List<double> { 100.0, 200.0, 50.0 };
       //Split features using EditOperation.Split overloads
       var splitFeatures = new EditOperation() { Name = "Split Features" };
    
       // split using varying distance
       var splitByVaryingDistance = new SplitByVaryingDistance() { Distances = distances, SplitFromStartPoint = true, ProportionRemainder = true };
       splitFeatures.Split(featureLayer, objectId, splitByVaryingDistance);
    
       //Execute to execute the operation
       //Must be called within QueuedTask.Run
       if (!splitFeatures.IsEmpty)
       {
         //Execute and ExecuteAsync will return true if the operation was successful and false if not
         var result = splitFeatures.Execute();
         //or use async flavor
         //await splitAtPointsFeatures.ExecuteAsync();
       }
     });
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also