Procedure GetRect draws a temporary "rubberband" rectangle onscreen, similar to a selection marquee. The user defines the rectangle by selecting two points which define the top left and bottom right of the rectangle. This cannot be used if there is a function anywhere in the calling chain.
PROCEDURE GetRect(
VAR p1X,p1Y : REAL;
VAR p2X,p2Y : REAL);def vs.GetRect(callback):
return None| Name | Type | Description |
|---|---|---|
| p1 | REAL | Returns coordinates of first user click. |
| p2 | REAL | Returns coordinates of second user click. |
In Python this function will NOT block execution. It will execute a callback function with the resulted rectangle (two points as callback function parameters).
on sample is similar to the sample in GetPt.
BEGIN
GetRect(x1, y1, x2, y2);
IF x2 = x1 THEN x2 := x1 + 100;
IF y2 = y1 THEN y2 := y1 + 100;
GetRect(x1, y1, x2, y2);
IF x1 >= x2 THEN x2 := x1 + 100;
IF y1 <= y2 THEN y2 := y1 - 100;import vs
# Procedure GetRect draws a temporary "rubberband" rectangle
# onscreen, similar to a selection marquee.
def handle_object(objHandle):
vs.Message('Processing: ' + str(objHandle))
callback = handle_object
vs.GetRect(callback)VS Functions: GetPt | GetPtL | GetPt3D | GetPtL3D | GetLine | GetLine3D | GetRect | GetRect3D | TrackObject
Availability: from All Versions