ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / PolylineBuilderEx Class / SplitAtDistance Method
The distance from the From point to insert the vertex.
True to treat the distance as a ratio (or %) of the part length.
(Optional) Specifies whether a new part is to be created when the part is split. The default value is false.
Example

SplitAtDistance Method (PolylineBuilderEx)
Introduces a new vertex into the last part of this polyline at a specified distance from the beginning of the polyline. For a split to happen, the split distance must be between the From and To points of the polycurve. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public int SplitAtDistance( 
   double distance,
   bool asRatio,
   bool createPart
)

Parameters

distance
The distance from the From point to insert the vertex.
asRatio
True to treat the distance as a ratio (or %) of the part length.
createPart
(Optional) Specifies whether a new part is to be created when the part is split. The default value is false.

Return Value

The new segment index.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
The distance is less than zero.
Remarks
createPart must be FALSE for polygons. For polylines, if createPart is TRUE, the part on which the new split point falls is split into two parts with the newly added vertex serving as the end of the first part and the beginning of the second.

Split At Distance

Example
Split Polyline at distance
// create list of points
MapPoint startPt = MapPointBuilderEx.CreateMapPoint(1.0, 1.0);
MapPoint endPt = MapPointBuilderEx.CreateMapPoint(2.0, 1.0);

List<MapPoint> list = new List<MapPoint>();
list.Add(startPt);
list.Add(endPt);

// BuilderEx constructors don't need to run on the MCT.

// use the PolylineBuilder as we wish to manipulate the geometry
// use AttributeFlags.None as we have 2D points
PolylineBuilderEx polylineBuilder = new PolylineBuilderEx(list, AttributeFlags.None);
// split at a distance 0.75
polylineBuilder.SplitAtDistance(0.75, false);
// get the polyline
Polyline p = polylineBuilder.ToGeometry();
// polyline p should have 3 points  (1,1), (1.75, 1), (2,1)

// add another path
MapPoint p1 = MapPointBuilderEx.CreateMapPoint(4.0, 1.0);
MapPoint p2 = MapPointBuilderEx.CreateMapPoint(6.0, 1.0);
MapPoint p3 = MapPointBuilderEx.CreateMapPoint(7.0, 1.0);
List<MapPoint> pts = new List<MapPoint>();
pts.Add(p1);
pts.Add(p2);
pts.Add(p3);

polylineBuilder.AddPart(pts);
p = polylineBuilder.ToGeometry();

// polyline p has 2 parts.  Each part has 3 points

// split the 2nd path half way - dont create a new path
polylineBuilder.SplitPartAtDistance(1, 0.5, true, false);

p = polylineBuilder.ToGeometry();

// polyline p still has 2 parts; but now has 7 points 
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

ArcGIS Pro version: 3.0 or higher.
See Also