ArcGIS Pro 2.8 API Reference Guide
ToGeometry() Method
Example 

ArcGIS.Core.Geometry Namespace > PolylineBuilder Class : ToGeometry() Method
Returns a Polyline instance representing the current state of the builder. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public override Polyline ToGeometry()
Public Overrides NotOverridable Function ToGeometry() As Polyline

Return Value

Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  using (PolylineBuilder polylineBuilder = new PolylineBuilder(polyline))
  {
    polylineBuilder.ReverseOrientation();
    Polyline reversedPolyline = polylineBuilder.ToGeometry();
  }
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

PolylineBuilder Class
PolylineBuilder Members