SclDragLine
Overview
Create a line in a 2D or 3D graphics viewport by using the mouse with a click and drag action ro define the start and end of the line.
Synopsis
SclDragLine $PromptText x1 y1 z1 x2 y2 z2
Description
The text in the PromptText argument is displayed to instruct the user to take the necessary action required to locate the cursor using the mouse and press the mouse button to define a line in a Graphics viewport.
This command is only appropriate for use in a window that contains either a 3D or 2D Graphics component.
The coordinates that are returned to define the start and end of the line are in the same coordinate space as the data that is displayed in the graphics window.
Arguments
- PromptText
Passed by value. The value of this argument is displayed in the graphics prompting region to instruct the user to perform the actions to define the line.
- x1, y1, z1
Passed by reference. These variables are assigned the X, Y and Z values of the position in the Graphics window where the mouse button is depressed.
- x2, y2, z2
Passed by reference. These variables are assigned the X, Y and Z values of the position in the Graphics window where the mouse button is released.
Returns
The SclDragLine command returns $SCL_OK if successful and $SCL_ERROR if escape is pressed.
Examples
set status [SclDragLine "Click and drag to define a line" x1 y1 z1 x2 y2 z2] puts "status=$status, start position x, y, z=$x1, $y1, $z1, end position x, y, \ z=$x2, $y2, $z2"