VS:EqPt

From Vectorworks Developer
Revision as of 17:31, 13 August 2008 by Root (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Description

Returns TRUE if the 2D points are equal within the tolerance.

FUNCTION EqPt(
pt1X, pt1Y, pt1Z :REAL;
pt2X, pt2Y, pt2Z :REAL;
tolerance :REAL) :BOOLEAN;
def vs.EqPt(pt1, pt2, tolerance):
    return BOOLEAN

Parameters

pt1X, pt1Y, pt1Z REAL
pt2X, pt2Y, pt2Z REAL
tolerance REAL

Example

PROCEDURE Example;
VAR
   pt1, pt2 :VECTOR;
   tol      :REAL;
BEGIN
   Message('Specify the first point...');
   GetPt(pt1.x, pt1.y);
   Message('Specify the second point...');
   GetPt(pt2.x, pt2.y);
   tol := RealDialog('Enter tolerance for comparison:', '0.001');
   IF EqPt(pt1, pt2, tol) 
      THEN AlrtDialog(Concat(pt1, ' == ', pt2, ' in tolerance:', tol))
      ELSE AlrtDialog(Concat(pt1, ' != ', pt2, ' in tolerance:', tol))
END;
RUN(Example);

Version

Availability: from All Versions

This is drop-in function.