Ask user to pick model and drawing objects

Updated: 13 May 2019

Use the Picker class to prompt the user to select model or drawing objects and points in Tekla Structures. The methods throw an exception if the user interrupts the pick command.

Picker class for model objects

The following code shows how to prompt the user to pick model objects.

//Create a new instance from the picker class
Picker Picker = new Picker();
Point p = null;
try
{
    // Create the point from user input
    p = Picker.PickPoint();
}
catch (Exception e)
{
    // User cancels selection (interrupt) 
}

Picker class for drawing objects

The following code shows how to prompt the user to pick drawing objects.

//Create a new instance from the DrawingHandler class
DrawingHandler drawingHandler = new DrawingHandler();

//Create a new instance from the picker class
Picker picker = drawingHandler.GetPicker();
Point point = null; 
ViewBase view = null; 
 
try 
{
    // Create the point from user input
    picker.PickPoint("Pick_point", out point, out view); 
} 
catch (PickerInterruptedException) 
{ 
    // User cancels selection (interrupt) 
}

 

Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.