VS:GetClosestSide

From Vectorworks Developer
Revision as of 14:30, 12 August 2013 by Root (talk | contribs) (1 revision)
(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 the indices of the vertices that define the side closest to the specified location.

GetClosestSide supports only 2D objects. If the object is unsupported, -1 will be returned as the index values.

PROCEDURE GetClosestSide(
obj :HANDLE;
ptX,ptY :REAL;
VAR index1 :INTEGER;
VAR index2 :INTEGER);
def vs.GetClosestSide(obj, pt):
    return (index1, index2)

Parameters

obj HANDLE Handle to object.
pt REAL Coordinates of location.
index1 INTEGER Index of first vertex of closest side.
index2 INTEGER Index of second vertex of closest side.

Remarks

Orso, 2011/12/31: If applied to polygons, the routine needs the passed point to be ON a side. It will return different values depending if

  • the chosen point is ON the side: always returns the vertexes defining the found side
  • the chosen point is NOT ON the side:
    • polygons: returns the range of vertexes --> 1-(count of vertexes)
    • polylines: returns the range of vertexes --> (count of vertexes) -(count of vertexes)

Version

Availability: from VectorWorks 8.5