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.

Picker Class

The Picker class can be used to query the user to do manual picks of objects and points from the Tekla Structures model. The methods throw an exception if the user interrupts (cancels) the pick command.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Model.UIPicker

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 Picker

The Picker type exposes the following members.

Constructors
  Name Description
Public method Picker
Creates a new picker instance.
Top
Methods
  Name Description
Public method PickFace
Queries the user to pick a face from the model.
Public method PickFace(String)
Queries the user to pick a face from the model with the given prompt.
Public method PickLine
Queries the user to pick a line from the model.
Public method PickLine(String)
Queries the user to pick a line from the model with the given prompt.
Public method PickObject(PickerPickObjectEnum)
Queries the user to pick one model object from the model.
Public method PickObject(PickerPickObjectEnum, String)
Queries the user to pick one model object from the model with the given prompt.
Public method PickObjects(PickerPickObjectsEnum)
Queries the user to pick model objects from the model.
Public method PickObjects(PickerPickObjectsEnum, String)
Queries the user to pick model objects from the model with the given prompt.
Public method PickPoint
Queries the user to pick a point from the model.
Public method PickPoint(String)
Queries the user to pick a point from the model with the given prompt.
Public method PickPoints(PickerPickPointEnum)
Queries the user to pick points from the model.
Public method PickPoints(PickerPickPointEnum, String)
Queries the user to pick points from the model with the given prompt.
Top
Remarks
Prompts

Tekla Structures prefixes the given prompt with "prompt_" and looks for a translation in the prompts.ail file. If the translation (e.g. "prompt_Pick_first_position") is not found in the prompts.ail file, the prompt string is displayed as such. This feature can be used to give already translated strings to the picker.

Examples
using Tekla.Structures.Model.UI;
using Tekla.Structures.Geometry3d;

using System;
using System.Windows.Forms;

public class Example
{
       public void Example1()
       {
           Picker Picker = new Picker();
           Point p = null;
           try
           {
               p = Picker.PickPoint();
           }
           catch (Exception e)
           {
               MessageBox.Show(e.ToString());
           }
       }
}
See Also