Adobe 26001360 - Illustrator CS - PC Manual page 388

Scripting guide
Hide thumbs Also See for 26001360 - Illustrator CS - PC:
Table of Contents

Advertisement

388
Notes
The PathItem class give you complete access to paths in Illustrator.
The SetEntirePath method provides an extremely efficient way to create paths which
consist of straight lines.
Example 47.1
This script sets the stroke color and the fill color of the first path in the frontmost document.
Dim appRef As New Illustrator.Application
Dim frontDocument As Illustrator.Document
Dim firstPath As Illustrator.PathItem
Set frontDocument = appRef.ActiveDocument
Set firstPath = frontDocument.PathItems(1)
firstPath.Filled = True
firstPath.fillColor = frontDocument.Swatches(10).Color
firstPath.Stroked = True
firstPath.StrokeWidth = 5
Example 47.2
This script illustrates the use of the SetEntirePath method to create a new path consisting
of straight lines.
Dim appRef As New Illustrator.Application
Dim frontDocument As Illustrator.Document
Dim newPath As Illustrator.PathItem
Dim lineList(10) As Variant
Dim index As Integer
For index = 0 To 10
lineList(index) = Array(index * 10 + 50, (index - 5) ^ 2 * 5 + 50)
Next
Set frontDocument = appRef.ActiveDocument
Set newPath = frontDocument.PathItems.Add
12 Aug 03
Visual Basic Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents