Adobe 26001360 Scripting Guide - Page 392
PathPoints, Table 5.96, PathPoints - Properties, PathPoints - Methods
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 392 highlights
392 Visual Basic Reference Dim firstPath As Illustrator.PathItem Dim currentPoint As Illustrator.PathPoint Dim nextPoint As Illustrator.PathPoint Dim countOfPoints As Integer Dim index As Integer Dim deltax, deltay, length As Double Set firstPath = appRef.ActiveDocument.PathItems(1) countOfPoints = firstPath.PathPoints.Count 'loop through all PathPoints except for the last one and set the 'left/right direction according to where the next point is For index = 1 To (countOfPoints - 1) Set currentPoint = firstPath.PathPoints(index) Set nextPoint = firstPath.PathPoints(index + 1) deltax = nextPoint.Anchor(0) - currentPoint.Anchor(0) deltay = currentPoint.Anchor(1) - nextPoint.Anchor(1) length = Math.Sqr(deltax ^ 2 + deltay ^ 2) currentPoint.LeftDirection = Array(currentPoint.Anchor(0) - _ (50 * deltax / length), currentPoint.Anchor(1) - (50 * deltay / length)) currentPoint.RightDirection = Array(currentPoint.Anchor(0) + _ (50 * deltax / length), currentPoint.Anchor(1) + (50 * deltay / length)) PathPoints A collection of path points in a specific path. Table 5.96 PathPoints - Properties Property Application Count Parent R/O Value type What it is R/O Application object The Illustrator Application object R/O Long The number of objects in the collection R/O object The object that contains this PathPoints object Table 5.97 PathPoints - Methods Method Add() Index(item As PathPoint) Returns PathPoint object Long What it does Creates a new object Returns the index position of the object within the collection 12 Aug 03