ArcGIS Pro 2.7 API Reference Guide
CreateLinearUnit(String) Method
Example 

ArcGIS.Core.Geometry Namespace > LinearUnit Class > CreateLinearUnit Method : CreateLinearUnit(String) Method
The well-known text.
Convenience method to create a LinearUnit instance from well-known text. This method is useful for creating a custom unit.
Syntax
public static LinearUnit CreateLinearUnit( 
   string unitWkt
)
Public Overloads Shared Function CreateLinearUnit( _
   ByVal unitWkt As String _
) As LinearUnit

Parameters

unitWkt
The well-known text.

Return Value

Example
// create a custom linear unit - there are 0.33 meters per myLinearUnit
var myLinearUnit = LinearUnit.CreateLinearUnit("myCustomLinearUnit", 0.33);
string name = myLinearUnit.Name;                          // myCustomLinearUnit
double convFactor = myLinearUnit.ConversionFactor;        // 0.33
int code = myLinearUnit.FactoryCode;                      // 0 for custom units
double metersUnit = myLinearUnit.MetersPerUnit;           // 0.33
string toString = myLinearUnit.ToString();                // same as Name - myCustomLinearUnit

// convert 10 centimeters to myLinearUnit 
double convertedVal = LinearUnit.Centimeters.ConvertTo(10, myLinearUnit);


// get the wkt
string lu_wkt = myLinearUnit.Wkt;

// create an angular unit from this wkt
var anotherLinearUnit = LinearUnit.CreateLinearUnit(lu_wkt);
// anotherLinearUnit.ConversionFactor = 0.33
// anotherLinearUnit.FactoryCode = 0    
// anotherLinearUnit.MetersPerUnit = 0.33
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

LinearUnit Class
LinearUnit Members
Overload List