DistanceList Constructor

Initializes a new instance of the structure.

Namespace:  Tekla.Structures.Datatype
Assembly:  Tekla.Structures.Datatype (in Tekla.Structures.Datatype.dll) Version: 2023.0.3
Syntax
public DistanceList(
	IEnumerable<Distance> distanceList
)

Parameters

distanceList
Type: System.Collections.GenericIEnumerableDistance
The distance list.
Examples
This example shows how to construct an empty DistanceList instance as well as a DistanceList instance from an existing enumerable collection of Distance instances. A copy of the collection is created, modifying the original collection does not affect the constructed DistanceList.
using Tekla.Structures.Datatype;

public class Example
{
       public void Example1()
       {
           // By default the constructor creates an empty list.
           DistanceList defaultList = new DistanceList();

           // Distance list can also be constructed from an array (or any other
           // enumerable collection) of Distance instances.
           Distance[] distances = { new Distance(30.2), new Distance(2.3) };

           // Distance lists created this way contain a copy of the source collection.
           // Modifying the original collection does not affect the constructed list.
           DistanceList distanceList = new DistanceList(distances);

           distanceList = defaultList;
       }
}
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