CwGetSelectionRectangle

Syntax:

flag = CwGetSelectionRectangle stem

        ("stem" is the name of a stem variable in which the results are
         stored.  There are 4 fields of the stem that are set.)

        flag            (boolean) True (1) if there is a selection rectangle
                        to get, false otherwise.

        stem.X          (numeric) The horizontal coordinate of the top-left
                        corner of the selection rectangle

        stem.Y          (numeric) The vertical coordinate of the top-left
                        corner of the selection rectangle

        stem.Width      (numeric) The width of the selection rectangle

        stem.Height     (numeric) The height of the selection rectangle

Description:

The selection rectangle is the rectangle normally created by clicking and dragging on a view window. It is used to select objects, define their initial size or outline a group. It can be set by via the user interface, or by calling CwSetSelectionRectangle.

The function CwGetSelectionRectangle gets the current selection rectangle if such a rectangle exists. If there is no selection rectangle, the return value is false (0) and the returned dimensions are invalid. Otherwise, the return value is true (1).

The point stem.X, stem.Y is actually the location of the center of the rectangle in the current unit. Stem.Width and stem.Height are the width and height of the rectangle, also in the current unit. The current unit is stored in the "Unit" property of the application-defined object "Output Settings".

Example:

/* Script to zoom to selection rectangle.*/
call CwGetSelectionRectangle rect
call CwSetViewZoom rect.x, rect.y, rect.width, rect.height


Functions by NAME

Index

Functions by PURPOSE