PathPoints
PathPoints
Section titled “PathPoints”app.activeDocument.pathItems[index].pathPoints
Description
Section titled “Description”A collection of PathPoint objects in a specific path.
The elements are not named; you must access them by index.
Properties
Section titled “Properties”PathPoints.length
Section titled “PathPoints.length”app.activeDocument.pathItems[index].pathPoints.length
Description
Section titled “Description”Number of elements in the collection.
Number; read-only.
PathPoints.parent
Section titled “PathPoints.parent”app.activeDocument.pathItems[index].pathPoints.parent
Description
Section titled “Description”The object’s container.
Object; read-only.
PathPoints.typename
Section titled “PathPoints.typename”app.activeDocument.pathItems[index].pathPoints.typename
Description
Section titled “Description”The class name of the object.
String; read-only.
Methods
Section titled “Methods”PathPoints.add()
Section titled “PathPoints.add()”app.activeDocument.pathItems[index].pathPoints.add()
Description
Section titled “Description”Creates a new object.
Returns
Section titled “Returns”PathPoints.index()
Section titled “PathPoints.index()”app.activeDocument.pathItems[index].pathPoints.index(itemKey)
Description
Section titled “Description”Gets an element from the collection.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
itemKey | String, Number | String or number key |
Returns
Section titled “Returns”PathPoints.removeAll()
Section titled “PathPoints.removeAll()”app.activeDocument.pathItems[index].pathPoints.removeAll()
Description
Section titled “Description”Deletes all elements in the collection.
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Adding a path point to a path
Section titled “Adding a path point to a path”// Appends a new PathPoint to an existing path// and initializes its anchor and handle points.if (app.documents.length > 0) { var doc = app.activeDocument;
var line = doc.pathItems.add(); line.stroked = true; line.setEntirePath(Array(Array(220, 475), Array(375, 300)));
// Append another point to the line var newPoint = doc.pathItems[0].pathPoints.add(); newPoint.anchor = Array(220, 300); newPoint.leftDirection = newPoint.anchor; newPoint.rightDirection = newPoint.anchor; newPoint.pointType = PointType.CORNER;}