VS:GetPtInPoly: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
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.
Finds a point inside a polyline.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION GetPtInPoly(h :HANDLE) VECTOR;
FUNCTION GetPtInPoly(h:HANDLE) : VECTOR;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 29: Line 28:
</lineList>
</lineList>
</params>
</params>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<remark></remark>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
 
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
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);</code>
 
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from All Versions
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
</seeAlso>


</vwDoc>
</vwDoc>

Revision as of 17:35, 18 September 2013

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

Description

Finds a point inside a polyline.

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

Parameters

h HANDLE

Version

Availability: from Vectorworks 2014