Tekla Open API

Detailed and full API reference helps you master Tekla Open API

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

DistanceFromDecimalString Method (String, IFormatProvider)

Creates a distance from a decimal string representation.

Namespace:  Tekla.Structures.Datatype
Assembly:  Tekla.Structures.Datatype (in Tekla.Structures.Datatype.dll) Version: 2019.0.0.0 (2019.0.0.0)
Syntax
public static Distance FromDecimalString(
	string text,
	IFormatProvider formatProvider
)

Parameters

text
Type: SystemString
The distance string.
formatProvider
Type: SystemIFormatProvider
The number format provider.

Return Value

Type: Distance
The representation of the specified distance.
Exceptions
Exception Condition
FormatException Thrown if the text does not represent a distance.
Examples
This example shows how to specify a format provider when parsing a Distance instance from a decimal string.
using Tekla.Structures.Datatype;
using System.Globalization;

public class Example
{
       public void Example1()
       {
           Distance distance = Distance.FromDecimalString("3.2", CultureInfo.InvariantCulture);
       }
}
See Also