VS:GetPolyPt
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Procedure GetPolyPt returns the coordinates of a specified vertex of the referenced object.
PROCEDURE GetPolyPt(
objectHd :HANDLE;
index :INTEGER;
VAR pX,pY :REAL);
def vs.GetPolyPt(objectHd, index): return p
Parameters
objectHd HANDLE Handle to polygon. index INTEGER Index of vertex (range of 1 to n). p REAL Returns coordinates of vertex.
Remarks
(Orso, 2010 Dec. 22) Since the introduction of rotated rectangles, it doesn't turn them into polygons any longer. The routine fails with warning, as expected.
(Charles Chandler, 2001 Jan. 25): Doesn't work on rectangles, unless you rotate them, which turns them into polygons.
(Gerard Jonker, 2007 Jan. 8) Please have a look at my comments on the VectorLab regarding this function, concerning index and origin.
Example
VectorScript
for i := 1 to GetVertNum(thePoly) do begin GetPolyPt(thePoly, i, vertX, vertY); end;
Python
def Example(): obj = vs.FSActLayer() for vertexNum in range(1, vs.GetVertNum(obj)): ptVt = vs.GetPolyPt(obj, vertexNum) vs.TextOrigin(ptVt[0], ptVt[1]) vs.CreateText(vs.Concat('vNum: ', vertexNum)) Example()
Version
Availability: from All Versions
See Also
For polygons:
For polylines:
For polygons:
- [[VS:SetPolyPt| SetPolyPt]]
For polylines:
- [[VS:GetPolylineVertex| GetPolylineVertex]]
- [[VS:SetPolylineVertex| SetPolylineVertex]]