Tekla Open API

Detailed and full API reference helps you master Tekla Open API

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

PickInput Class

The PickInput class handles the input of picked objects and positions.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Model.UIPickInput

Namespace:  Tekla.Structures.Model.UI
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
[SerializableAttribute]
public sealed class PickInput : ICollection, 
	IEnumerable

The PickInput type exposes the following members.

Properties
  Name Description
Public property Count
Gets the number of elements contained in the ICollection.
Public property IsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
Public property SyncRoot
Gets an object that can be used to synchronize access to the ICollection.
Top
Methods
  Name Description
Public method CopyTo
Copies the elements of the ICollection to an Array, starting at a particular Array index.
Public methodCode example GetEnumerator
Returns an enumerator that iterates through a collection.
Top
Examples
The following example asks the user to pick a face and then shows the input for the plug-in:
using Tekla.Structures.Model;
using Tekla.Structures.Model.UI;
using Tekla.Structures.Geometry3d;
using TSG = Tekla.Structures.Geometry3d;

using System;
using System.Collections;
using System.Windows.Forms;

public class Example
{
    public void Example1()
    {
        Picker Picker = new Picker();
        try
        {
            PickInput Input = Picker.PickFace("");
            IEnumerator MyEnum = Input.GetEnumerator();
            while (MyEnum.MoveNext())
            {
                InputItem Item = MyEnum.Current as InputItem;
                if (Item.GetInputType() == InputItem.InputTypeEnum.INPUT_1_OBJECT)
                {
                    ModelObject M = Item.GetData() as ModelObject;
                    MessageBox.Show(M.Identifier.ToString());
                }
                if (Item.GetInputType() == InputItem.InputTypeEnum.INPUT_POLYGON)
                {
                    ArrayList Points = Item.GetData() as ArrayList;
                    MessageBox.Show((Points[0] as TSG.Point).ToString());
                }
            }
        }
        catch (Exception e)
        {
            MessageBox.Show(e.ToString());
        }
    }
}
See Also