You are here: Surpac Concepts > Macros > SCL > Graphical Selection > SclDragSegment
GEOVIA Surpac

SclDragSegment and SclDragSegmentConstrained

Overview

Provide feedback to define the displacement of a segment from an existing position to a new position.

Note: The actual coordinates of the segment are not changed. This function returns the difference in X,Y and Z values only.

Synopsis

SclDragSegment SegmentHandle $PromptText delx dely delz
SclDragSegmentConstrained SegmentHandle $PromptText $Constraint delx dely delz

Description

The text in the PromptText argument is displayed to instruct the user to take the necessary action required to select and drag a segment to a new location.

This command is only appropriate for use in a window that contains a 3D Graphics component.

The delta values that are returned to define the change in the X,Y and Z values from the current location of the segment to the location where the mouse button is released.

The constrained variant restricts the freedom of the movement to be in a particular plane or direction.

Arguments

  • SegmentHandle
  • Passed by reference. The unique handle to the selected segment is returned in this variable. This handle may be used in subsequent Scl commands to modify the coordinates or other attributes of the segment.

  • 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 select and move the segment.

  • Constraint
  • The movement of the segment to its new location may be constrained to be only in a plane of interest or to just a direction of interest. Permitted values include:

    • XYZ
    • Three degrees of freedom. Movement may be in any direction and is the same as using SclDragSegment.

    • XY, YZ, XZ
    • Two degrees of freedom. Movement will only occur in the specified plane.

    • X, Y, Z
    • One degree of freedom. Movement will only occur in the specified direction.

  • delx, dely, delz
  • Passed by reference. These variables are assigned the X, Y and Z values of change in location of the selected segment.

Returns

The SclDragSegment and SclDragSegmentConstrained commands return $SCL_OK if successful and $SCL_ERROR if escape is pressed.

Examples

# Drag a segment with 3 degrees of freedom
set status [SclDragSegment segment "Drag a segment to a new location" delx dely \
delz]
if { $status == $SCL_OK } {
  puts "Segment coordinates = ($delx, $dely, $delz)"
} else {
  puts "Error draging segment - probably cancelled by user"
}
# Drag a segment in the XY plane only
set status [SclDragSegmentConstrained segment "Drag a segment to a new location" \
XY delx dely delz]
if { $status == $SCL_OK } {
  puts "Segment coordinates = ($delx, $dely, $delz)"
} else {
  puts "Error draging segment - probably cancelled by user"
}
# Drag a segment in the Z direction only
set status [SclDragSegmentConstrained segment "Drag a segment to a new location" \
Z delx dely delz]
if { $status == $SCL_OK } {
  puts "Segment coordinates = ($delx, $dely, $delz)"
} else {
  puts "Error draging segment - probably cancelled by user"
}

See Also

SclDragPointSclDragString