VS:MouseDown

From Vectorworks Developer
Revision as of 08:32, 9 July 2019 by MaKro (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Function MouseDown returns TRUE if a mouse down event has occurred within the active document window.

Remark for VW2014 python: return value for the point is always an empty tuple (0, 0)

FUNCTION MouseDown(
VAR pX,pY :REAL) : BOOLEAN;
def vs.MouseDown():
    return (bool, (px, py))

Parameters

p REAL Returns coordinates of mouse click.

Example

VectorScript

REPEAT
UNTIL MouseDown(x1,y1);
REPEAT
UNTIL MouseDown(x2,y2);
MoveTo(x1,y1);
LineTo(x2,y2);

Python

down = False
while not down:
    down, pt = vs.MouseDown()  # pt is a tuple (x, y)

vs.AlrtDialog(str(pt))

Version

Availability: from All Versions