User Guide
707
vertex
Syntax
member(whichVectorShapeMember).vertex[whichVertexPosition]
Description
Chunk expression; enables direct access to parts of a vertex list of a vector shape cast member.
Use this chunk expression to avoid parsing different chunks of the vertex list. It’s possible to both
test and set values of the vertex list using this type of chunk expression.
Examples
The following code shows how to determine the number of vertex points in a member:
put member("Archie").vertex.count
-- 2
To obtain the second vertex for the member, you can use code like this:
put member("Archie").vertex[2]
-- point(66.0000, -5.0000)
You can also set the value in a control handle:
member("Archie").vertex[2].handle1 = point(-63.0000, -16.0000)
See also
vertexList
vertexList
Syntax
member(whichVectorShapeMember).vertexList
Description
Cast member property; returns a linear list containing property lists, one for each vertex of a
vector shape. The property list contains the location of the vertex and the control handle. There
are no control handles if the location is (0,0).
Each vertex can have two control handles that determine the curve between this vertex and the
adjacent vertices. In
vertexList, the coordinates of the control handles for a vertex are kept
relative to that vertex, rather than absolute in the coordinate system of the shape. If the first
control handle of a vertex is located 10 pixels to the left of that vertex, its location is stored as (-
10, 0). Thus, when the location of a vertex is changed with Lingo, the control handles move with
the vertex and do not need to be updated (unless the user specifically wants to change the location
or size of the handle).
When modifying this property, be aware that you must reset the list contents after changing any
of the values. This is because when you set a variable to the value of the property, you are placing
a copy of the list, not the list itself, in the variable. To effect a change, use code like this:
- Get the current property contents
currVertList = member(1).vertexList
-- Add 25 pixels to the horizontal and vertical positions of the first vertex
in the list
currVertList[1] .vertex = currVertList[1] .vertex + point(25, 25)
-- Reset the actual property to the newly computed position
member(1).vertexList = currVertList