ArcGIS Pro 2.7 API Reference Guide
DensifyByLength Method (GeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class : DensifyByLength Method
The geometry to be densified.
The maximum segment length allowed in the output geometry.
Densifies the specified geometry.
Syntax
public Geometry DensifyByLength( 
   Geometry geometry,
   double maxSegmentLength
)
Public Function DensifyByLength( _
   ByVal geometry As Geometry, _
   ByVal maxSegmentLength As Double _
) As Geometry

Parameters

geometry
The geometry to be densified.
maxSegmentLength
The maximum segment length allowed in the output geometry.

Return Value

Returns the densified geometry.
Exceptions
ExceptionDescription
The method is not implemented for GeometryBag or Multipatch.
Geometry is null or empty.
Remarks
The densify operation adds vertices to the input geometry.

GeometryEngine DensifyByLength

Example
// densify a line segment
MapPoint startPt = MapPointBuilder.CreateMapPoint(1.0, 1.0);
MapPoint endPt = MapPointBuilder.CreateMapPoint(1, 21);
LineSegment line = LineBuilder.CreateLineSegment(startPt, endPt);
Polyline polyline = PolylineBuilder.CreatePolyline(line);

Geometry geom = GeometryEngine.Instance.DensifyByLength(polyline, 2);
Polyline result = geom as Polyline;


// densify a circular arc
MapPoint fromPt = MapPointBuilder.CreateMapPoint(2, 1);
MapPoint toPt = MapPointBuilder.CreateMapPoint(1, 2);
Coordinate2D interiorPt = new Coordinate2D(1 + Math.Sqrt(2) / 2, 1 + Math.Sqrt(2) / 2);

using (EllipticArcBuilder cab = new EllipticArcBuilder(fromPt, toPt, interiorPt))
{
  EllipticArcSegment circularArc = cab.ToSegment();
  polyline = PolylineBuilder.CreatePolyline(circularArc);
  geom = GeometryEngine.Instance.DensifyByLength(polyline, 2);
  result = geom as Polyline;
}
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

GeometryEngine Class
GeometryEngine Members