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 is used to pick points and objects in the drawing.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Drawing.UIPicker

Namespace:  Tekla.Structures.Drawing.UI
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
public sealed class Picker

The Picker type exposes the following members.

Methods
  Name Description
Public method IsInteractive
Indicates whether the picker is interactive and currently allowed to access the UI or not. If not, then the plug-in should avoid making dialog calls or message boxes.
Public method PickObject(String)
Requests the user to pick one object. Returns the picked drawing object and the view in which the pick occurred.
Public method PickObject(String, DrawingObject, ViewBase)
Requests the user to pick one object.
Public method PickObject(String, DrawingObject, ViewBase, Point)
Requests the user to pick one object. Returns the picked point in addition to the picked object.
Public method PickObject(String, Type, DrawingObject, ViewBase, Point)
Requests the user to pick one object of the given types. Returns the picked point in addition to the picked object.
Public method PickObjectAndPoint
Requests the user to pick one object. Returns the picked drawing object, the view in which the pick occurred and picked point in the view coordinates.
Public method PickPoint(String)
Requests the user to pick one point. Returns the picked point in the view coordinates and the view in which the pick occurred.
Public method PickPoint(String, Point, ViewBase)
Requests the user to pick one point.
Public method PickPoints(StringList)
Requests picks of points from the user. The sequence is terminated by the middle button pick. Returns the picked points in the view coordinates and the view in which the pick occurred.
Public method PickPoints(Int32, StringList)
Requests N picks of points from the user. Returns the picked points in the view coordinates and the view in which the pick occurred.
Public method PickPoints(StringList, PointList, ViewBase)
Requests picks of points from the user. The sequence is terminated by the middle button pick.
Public method PickPoints(Int32, StringList, PointList, ViewBase)
Requests N picks of points from the user.
Public method PickThreePoints
Requests a pick of three points from the user.
Public method PickTwoPoints
Requests a pick of two points from the user.
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.

using Tekla.Structures.Drawing;
using Tekla.Structures.Drawing.UI;
using Tekla.Structures.Geometry3d;

public class Example
{
       public void Example1()
       {
           DrawingHandler drawingHandler = new DrawingHandler();
           Picker picker = drawingHandler.GetPicker();
           Point point = null;
           ViewBase view = null;

           string prompt = "Picke zwei Punkte um die Richtung vorzugeben";
           picker.PickPoint(prompt, out point, out view);
       }
}
Examples
using Tekla.Structures.Drawing;
using Tekla.Structures.Drawing.UI;
using Tekla.Structures.Geometry3d;

public class Example
{
       public void PickPointExample()
       {
           var drawingHandler = new DrawingHandler();

           Picker picker = drawingHandler.GetPicker();

           try
           {
               var pick = picker.PickPoint("Pick_point");
               var point = pick.Item1;
               var view = pick.Item2;
               // Do something with the picked point and view.
           }
           catch(PickerInterruptedException)
           {
               // No pick happened
           }
       }
}
See Also