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.

DistanceListToArray Method

Copies the contents of the list into a new array.

Namespace:  Tekla.Structures.Datatype
Assembly:  Tekla.Structures.Datatype (in Tekla.Structures.Datatype.dll) Version: 2023.0.1
Syntax
public Distance[] ToArray()

Return Value

Type: Distance
The array of distances.
Examples
This example shows how to copy the Distance instances in a DistanceList to a new array.
using Tekla.Structures.Datatype;

public class Example
{
       public void Example1()
       {
           Distance[] distances = { new Distance(30.2), new Distance(2.3) };
           DistanceList distanceList = new DistanceList(distances);

           // We can copy the list contents to a new array. This allows us to
           // enumerate the contents even if the list changes during the enumeration.
           Distance[] distancesInArray = distanceList.ToArray();

           foreach(Distance distance in distancesInArray)
           {
               string formattedDistance = distance.ToString();
           }
       }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.