ArcGIS Pro 2.6 API Reference Guide
ExportToWKT Method (GeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class : ExportToWKT Method
A combination of WKTExportFlags which determines how the geometry is exported.
The input geometry to write to a string.
Writes an OGC well-known text formatted version of the input geometry to a string.
Syntax
Public Function ExportToWKT( _
   ByVal exportFlags As WKTExportFlags, _
   ByVal geometry As Geometry _
) As String

Parameters

exportFlags
A combination of WKTExportFlags which determines how the geometry is exported.
geometry
The input geometry to write to a string.

Return Value

An OCG well-known text format of the input geometry.
Exceptions
ExceptionDescription
Geometry is null or empty.
The method is not implemented for GeometryBag or Multipatch.
The method is not implemented for geometry with curves.
Remarks
Does not support curves. Also, note that if the geometry contains ID information, this property will not be preserved in the export operation. The WKT OGC standard does not contain the ID property.
Example
// create a point with z, m
MapPoint point = MapPointBuilder.CreateMapPoint(100, 200, 300, 400, SpatialReferences.WebMercator);

// set the flags
WKTExportFlags wktExportFlags = WKTExportFlags.wktExportDefaults;
WKTImportFlags wktImportFlags = WKTImportFlags.wktImportDefaults;

// export and import
string wktString = GeometryEngine.Instance.ExportToWKT(wktExportFlags, point);
MapPoint importPoint = GeometryEngine.Instance.ImportFromWKT(wktImportFlags, wktString, SpatialReferences.WebMercator) as MapPoint;

double x = importPoint.X;       // x = 100
double y = importPoint.Y;       // y = 200
bool hasZ = importPoint.HasZ;   // hasZ = true
double z = importPoint.Z;       // z = 300
bool hasM = importPoint.HasM;   // hasM = true
double m = importPoint.M;       // m = 400

// export without z
WKTExportFlags exportFlagsNoZ = WKTExportFlags.wktExportStripZs;
wktString = GeometryEngine.Instance.ExportToWKT(exportFlagsNoZ, point);
importPoint = GeometryEngine.Instance.ImportFromWKT(wktImportFlags, wktString, SpatialReferences.WebMercator) as MapPoint;

x = importPoint.X;        // x = 100
y = importPoint.Y;        // y = 200
hasZ = importPoint.HasZ;  // hasZ = false
z = importPoint.Z;        // z = 0
hasM = importPoint.HasM;  // hasM = true
m = importPoint.M;        // m = 400

// export without m
WKTExportFlags exportFlagsNoM = WKTExportFlags.wktExportStripMs;
wktString = GeometryEngine.Instance.ExportToWKT(exportFlagsNoM, point);
importPoint = GeometryEngine.Instance.ImportFromWKT(wktImportFlags, wktString, SpatialReferences.WebMercator) as MapPoint;

x = importPoint.X;        // x = 100
y = importPoint.Y;        // y = 200
hasZ = importPoint.HasZ;  // hasZ = true
z = importPoint.Z;        // z = 300
hasM = importPoint.HasM;  // hasM = false
m = importPoint.M;        // m = Nan

// export without z, m
wktString = GeometryEngine.Instance.ExportToWKT(exportFlagsNoZ | exportFlagsNoM, point);
importPoint = GeometryEngine.Instance.ImportFromWKT(wktImportFlags, wktString, SpatialReferences.WebMercator) as MapPoint;

x = importPoint.X;        // x = 100
y = importPoint.Y;        // y = 200
hasZ = importPoint.HasZ;  // hasZ = false
z = importPoint.Z;        // z = 0
hasM = importPoint.HasM;  // hasM = false
m = importPoint.M;        // m = Nan
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

GeometryEngine Class
GeometryEngine Members