VS:GetPtInPoly

From Vectorworks Developer
Revision as of 17:34, 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

Finds a point inside a polyline. The point is found by the following method: draw a line from the HCenter of the poly to the centroid. Find all of the intersections between this line and the poly. Use the two intersections closest to the centroid. Average them, and return the result.

FUNCTION GetPtInPoly(
h :HANDLE) VECTOR;
def vs.GetPtInPoly(h):
    return VECTOR

Parameters

h HANDLE

Example

PROCEDURE Example;
VAR
   h :HANDLE;
   p :VECTOR;
BEGIN
   h := FSActLayer;
   IF h = NIL THEN
      AlrtDialog('Select a polyline object')
   ELSE BEGIN
      p := GetPtInPoly(h);
      Locus(p.x, p.y);
   END;
END;
RUN(Example);

Version

Availability: from All Versions

This is drop-in function.