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: 2024.0.0+a110b435391768740483e3032720a566518c9a63
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.
Previous
Next