ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing Namespace / SplitByDistance Class / SplitByDistance Constructor
Example

In This Topic
    SplitByDistance Constructor
    In This Topic
    Create a new Split By Distance object.
    Syntax
    Public Function New()
    public SplitByDistance()
    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