VS:PtInRect

From Vectorworks Developer
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 PtInRect returns whether the coordinate location is located within the specified rectangular boundary.

FUNCTION PtInRect(
pointX,pointY :REAL;
rect1X,rect1Y :REAL;
rect2X,rect2Y :REAL) : BOOLEAN;
def vs.PtInRect(point, rect1, rect2):
    return BOOLEAN

Parameters

point REAL X-Y coordinate point location.
rect1 REAL Top left coordinate of rectangular area.
rect2 REAL Bottom right coordinate of rectangular area.

Example

VectorScript

PROCEDURE Example;
VAR
pointX, pointY, rect1X, rect1Y, rect2X, rect2Y :REAL;
BEGIN
pointX := 1;
pointY := 1;
rect1X := 0;
rect1Y := 2;
rect2X := 2;
rect2Y := 0;
Message(PtInRect(pointX, pointY, rect1X, rect1Y, rect2X, rect2Y));
END;
RUN(Example);

Python


Version

Availability: from All Versions