VS:GetPolylineVertex: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
No edit summary |
||
Line 63: | Line 63: | ||
* the same as the actual displayed radius, | * the same as the actual displayed radius, | ||
* larger than the displayed radius, in which case the drawn radius is the biggest radius that will fit. | * larger than the displayed radius, in which case the drawn radius is the biggest radius that will fit. | ||
MaKro 2022: | |||
* Corner vertex, which has no radius at all, returns value other than zero for radius, so always check vertex type. | |||
* The internally stored radius can be different to the one showed in the info palette. Use [[VS:GetPolylineArcMaxRadius]] | |||
</remark> | </remark> | ||
Line 111: | Line 115: | ||
For polylines: | For polylines: | ||
* [[VS:SetPolylineVertex| SetPolylineVertex]] | * [[VS:SetPolylineVertex| SetPolylineVertex]] | ||
* [[VS:GetPolylineArcMaxRadius]] | |||
For polygons: | For polygons: |
Revision as of 07:43, 19 October 2021
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Returns information about the specified polyline vertex.
Note that vertexNum is 1-based for Polygons and Polylines, and 0-based for 3D Polylines.
PROCEDURE GetPolylineVertex(
obj :HANDLE;
vertexNum :INTEGER;
VAR pX,pY :REAL;
VAR vertexType :INTEGER;
VAR arcRadius :REAL);
def vs.GetPolylineVertex(obj, vertexNum): return (p, vertexType, arcRadius)
Parameters
obj HANDLE Handle to object. vertexNum INTEGER Index of vertex to be queried. p REAL X-Y coordinates of vertex. vertexType INTEGER Type of vertex. arcRadius REAL Radius of vertex corner (arc vertex only).
Remarks
Retrieves information about a polyline vertex. Vertex type constant values are
- 0 - Corner
- 1 - Bezier
- 2 - Cubic
- 3 - Arc
(Charles Chandler, 2001 Jun. 11) The radius value can be one of three things:
- 0, in which case the actual drawn radius is simply the biggest radius that will fit,
- the same as the actual displayed radius,
- larger than the displayed radius, in which case the drawn radius is the biggest radius that will fit.
MaKro 2022:
- Corner vertex, which has no radius at all, returns value other than zero for radius, so always check vertex type.
- The internally stored radius can be different to the one showed in the info palette. Use VS:GetPolylineArcMaxRadius
Example
VectorScript
PROCEDURE Example; VAR obj :HANDLE; vertexNum :INTEGER; ptX, ptY :REAL; vertexType :INTEGER; arcRadius :REAL; BEGIN obj := FSActLayer; FOR vertexNum := 1 TO GetVertNum(obj) DO BEGIN GetPolylineVertex(obj, vertexNum, ptX, ptY, vertexType, arcRadius); TextOrigin(ptX, ptY); CreateText(Concat('vNum: ', vertexNum, ' vType: ', vertexType, ' radius: ', arcRadius)); END; END; RUN(Example);
Python
def Example(): obj = vs.FSActLayer() for vertexNum in range(1, vs.GetVertNum(obj)): ptVt, vertexType, arcRadius = vs.GetPolylineVertex(obj, vertexNum) vs.TextOrigin(ptVt[0], ptVt[1]) vs.CreateText(vs.Concat('vNum: ', vertexNum, ' vType: ', vertexType, ' radius: ', arcRadius)) Example()
Version
Availability: from VectorWorks 8.5
See Also
For polylines:
For polygons:
For polylines:
- [[VS:SetPolylineVertex| SetPolylineVertex]]
- [[VS:GetPolylineArcMaxRadius]]
For polygons:
- [[VS:GetPolyPt| GetPolyPt]]
- [[VS:SetPolyPt| SetPolyPt]]