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.

DistanceListParse Method (String, IFormatProvider)

Parses a distance list from a string representation.

Namespace:  Tekla.Structures.Datatype
Assembly:  Tekla.Structures.Datatype (in Tekla.Structures.Datatype.dll) Version: 2019.0.0.0 (2019.0.0.0)
public static DistanceList Parse(
	string input,
	IFormatProvider formatProvider


Type: SystemString
The input string.
Type: SystemIFormatProvider
The format provider.

Return Value

Type: DistanceList
The distance list.
This example shows how to override the format provider when parsing distance lists. The Tekla Structures convention is to use a dot as the decimal separator in all locales.
using Tekla.Structures.Datatype;
using System.Globalization;

public class Example
       public void Example1()
           // Current unit type controls the default unit type used in parsing.
           // The default unit is millimeter.
           Distance.CurrentUnitType = Distance.UnitType.Millimeter;

           // Tekla Structures uses dot as the decimal separator in all locales.
           // This will be parsed as 3 times 30.2 millimeters.
           DistanceList TeklaStructuresFormat = DistanceList.Parse("3*30.2", CultureInfo.InvariantCulture);

           // If the distance contains the unit, the distances are converted automatically.
           // This will be parsed as 3 times 30.2 meters.
           DistanceList distancesInMeters = DistanceList.Parse("3*30.2m", CultureInfo.InvariantCulture);
See Also