VS:GetClosestSide

From Vectorworks Developer
Jump to: navigation, 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
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox