API Reference

Detailed and full API reference helps you master Tekla development

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

Meta.Microsoft.Help.Id
M:Tekla.Structures.Datatype.DistanceList.ToString

DistanceListToString Method

Returns the string representation of the distance list.

Namespace:  Tekla.Structures.Datatype
Assembly:  Tekla.Structures.Datatype (in Tekla.Structures.Datatype.dll) Version: 2020.0.0.0 (2020.0.55582.0)
Syntax
public override string ToString()

Return Value

Type: String
The string representation of the distance list.
Examples
This example shows how to format a DistanceList with the current culture information and the current unit type.
using Tekla.Structures.Datatype;

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

           // UseFractionalFormat controls whether the feet and inches are formatted
           // using the fractional representation. The default value is false which
           // causes the feet and inches to be represented as decimal numbers.
           Distance.UseFractionalFormat = false;

           // UseUnitsInDecimalString controls whether the unit type is shown in the
           // decimal string representation. The default is false.
           Distance.UseUnitsInDecimalString = false;

           // We'll use this distance list to demonstrate the formatting.
           DistanceList distanceList = new DistanceList(new Distance[]
                                                       {
                                                           new Distance(30.2),
                                                           new Distance(30.2),
                                                           new Distance(30.2),
                                                           new Distance(50),
                                                           new Distance(2.3),
                                                           new Distance(2.3),
                                                       });

           // The default format uses the current unit type, current culture info and 
           // the default number format.
           string defaultFormat = distanceList.ToString();
       }
}
See Also