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.#ctor(System.Collections.Generic.IEnumerable{Tekla.Structures.Datatype.Distance})

DistanceList Constructor

Initializes a new instance of the structure.

Namespace:  Tekla.Structures.Datatype
Assembly:  Tekla.Structures.Datatype (in Tekla.Structures.Datatype.dll) Version: 2020.0.0.0 (2020.0.55582.0)
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