# Difference between revisions of "VS:GetPolyPt3D"

From Vectorworks Developer

m (1 revision) |
m |
||

Line 48: | Line 48: | ||

Gerard Jonker, 2007/1/8: Please have a look at my [http://www.vectorlab.info/index.php?title=Absolute_Origin comments on the VectorLab] regarding this function, concerning index and origin. | Gerard Jonker, 2007/1/8: Please have a look at my [http://www.vectorlab.info/index.php?title=Absolute_Origin comments on the VectorLab] regarding this function, concerning index and origin. | ||

+ | |||

+ | Conrad Preen, 2014/10/12: Save you the trip to VectorLab, index is zero-based and points returned w.r.t. internal origin. | ||

[[User:Orso.b.schmid| Orso]], 2010/09/12: Warning: From VW13 this function returns the z-value adding the layer Z. So, for example, by a layer z of 10, if you have a vertex whose z is 1, the routine will return 11.</remark> | [[User:Orso.b.schmid| Orso]], 2010/09/12: Warning: From VW13 this function returns the z-value adding the layer Z. So, for example, by a layer z of 10, if you have a vertex whose z is 1, the routine will return 11.</remark> |

## Latest revision as of 07:22, 12 October 2014

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

## Description

Procedure GetPolyPt3D returns the coordinates of the specified vertex of the referenced mesh, 3D polygon, or NURBS curve object.Error checking for valid index values must be provided by the programmer.

PROCEDURE GetPolyPt3D(

objectHd :HANDLE;

index :INTEGER;

VAR pX,pY,pZ :REAL);

def vs.GetPolyPt3D(objectHd, index): return p

## Parameters

objectHd HANDLE Handle to 3D mesh or polygon. index INTEGER Index of vertex (range of 0 to n-1). p REAL Returns 3D coordinates of vertex.

## Remarks

Gerard Jonker, 2007/1/8: Please have a look at my comments on the VectorLab regarding this function, concerning index and origin.Conrad Preen, 2014/10/12: Save you the trip to VectorLab, index is zero-based and points returned w.r.t. internal origin.

Orso, 2010/09/12: Warning: From VW13 this function returns the z-value adding the layer Z. So, for example, by a layer z of 10, if you have a vertex whose z is 1, the routine will return 11.

## Example

#### VectorScript

FOR i := 0 TO (GetVertNum(thePoly) - 1) DO BEGIN GetPolyPt3D(thePoly, i, vertX, vertY, vertZ); END;

#### Python

def Example(): obj = vs.FSActLayer() for vertexNum in range(1, vs.GetVertNum(obj)): ptVt = vs.GetPolyPt3D(obj, vertexNum) vs.TextOrigin(ptVt[0], ptVt[1], ptVt[2]) vs.CreateText(vs.Concat('vNum: ', vertexNum)) Example()