VS:GetPolyPt3D: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (Transfer Orso to _c_)
(add see also, fix examples)
 
Line 46: Line 46:
<remark>
<remark>


Conrad Preen, 2014/10/12: Save you the trip to VectorLab, index is zero-based and points returned w.r.t. internal 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.
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:CBM-c-|_c_]], 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:CBM-c-|_c_]], 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>
Line 55: Line 54:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<sample>
==== VectorScript ====
==== VectorScript ====
<code lang="pas">
<code lang="pas">
for i := 0 to (GetVertNum(thePoly) - 1) do
FOR i := 0 to (GetVertNum(thePoly) - 1) DO
begin
    GetPolyPt3D(thePoly, i, vertX, vertY, vertZ);
GetPolyPt3D(thePoly, i, vertX, vertY, vertZ);
end;
</code>
</code>
==== Python ====
==== Python ====
<code lang="py">
<code lang="py">
def Example():
def Example():
obj = vs.FSActLayer()
    obj = vs.FSActLayer()
for vertexNum in range(1, vs.GetVertNum(obj)):
    for vertexNum in range(1, vs.GetVertNum(obj)):
ptVt = vs.GetPolyPt3D(obj, vertexNum)
        ptVt = vs.GetPolyPt3D(obj, vertexNum)
vs.TextOrigin(ptVt[0], ptVt[1], ptVt[2])
        vs.TextOrigin(ptVt[0], ptVt[1], ptVt[2])
vs.CreateText(vs.Concat('vNum: ', vertexNum))
        vs.CreateText(vs.Concat('vNum: ', vertexNum))
 
Example()
Example()
</code>
</code>
Line 77: Line 75:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from MiniCAD7.0
Availability: from MiniCAD 7.0


</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
VS Functions:
* [[VS:Get2DPt]]
* [[VS:GetPolyPt]]
* [[VS:GetPolylineVertex]]
</seeAlso>


</vwDoc>
</vwDoc>

Latest revision as of 07:38, 22 January 2022

.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

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

Gerard Jonker, 2007/1/8: Please have a look at my comments on the VectorLab regarding this function, concerning index and origin.

_c_, 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
    GetPolyPt3D(thePoly, i, vertX, vertY, vertZ);

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()

Version

Availability: from MiniCAD 7.0

See Also

VS Functions:

VS Functions:
  • [[VS:Get2DPt]]
  • [[VS:GetPolyPt]]
  • [[VS:GetPolylineVertex]]