VS:vstGetPt2D: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 52: Line 52:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<remark>
Note that [[VS:vstNumPts]] will return a 1-based index. vstGetPt2D is zero-based. So if you're collecting points in the kToolEventPointAdded event you'll likely have to do something like
Note that [[VS:vstNumPts]] will return the number of clicked points (a 1-based index). vstGetPt2D is zero-based. So if you're collecting points in the kToolEventPointAdded event you'll likely have to do something like


<code>
<code>
Line 58: Line 58:
  vstGetPt2D(pointNum-1, ...);
  vstGetPt2D(pointNum-1, ...);
</code>
</code>
[MaKro 6/2018]: ... consider using VS:vstGetCurrPt2D ...


</remark>
</remark>

Revision as of 08:27, 6 July 2018

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

Description

Returns the point clicked by the user. inPtIndex is 0-based. If you pass in an index that is greater than the number of points clicked by the user, result will be false.

PROCEDURE vstGetPt2D(
inPtIndex :LONGINT;
VAR outX :REAL;
VAR outY :REAL;
result :BOOLEAN);
def vs.vstGetPt2D(inPtIndex, result):
    return (outX, outY)

Parameters

inPtIndex LONGINT
outX REAL Output parameter.
outY REAL Output parameter.
result BOOLEAN

Remarks

Note that VS:vstNumPts will return the number of clicked points (a 1-based index). vstGetPt2D is zero-based. So if you're collecting points in the kToolEventPointAdded event you'll likely have to do something like

vstNumPoints(pointNum);
vstGetPt2D(pointNum-1, ...);

[MaKro 6/2018]: ... consider using VS:vstGetCurrPt2D ...

Version

Availability: from All Versions

This is drop-in function.