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: 2023.0.3
Syntax
public sealed class Picker

The Picker type exposes the following members.

Methods
  NameDescription
Public methodIsInteractive
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 methodPickObject(String)
Requests the user to pick one object. Returns the picked drawing object and the view in which the pick occurred.
Public methodPickObject(String, DrawingObject, ViewBase)
Requests the user to pick one object.
Public methodPickObject(String, DrawingObject, ViewBase, Point)
Requests the user to pick one object. Returns the picked point in addition to the picked object.
Public methodPickObject(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 methodPickObjectAndPoint
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 methodPickPoint(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 methodPickPoint(String, Point, ViewBase)
Requests the user to pick one point.
Public methodPickPoints(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 methodPickPoints(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 methodPickPoints(StringList, PointList, ViewBase)
Requests picks of points from the user. The sequence is terminated by the middle button pick.
Public methodPickPoints(Int32, StringList, PointList, ViewBase)
Requests N picks of points from the user.
Public methodPickThreePoints
Requests a pick of three points from the user.
Public methodPickTwoPoints
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
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next