Adobe 26001360 Scripting Guide - Page 295
Brush, Notes, Example 2.1
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 295 highlights
Adobe Illustrator CS Scripting Guide 295 Brush A brush in an Illustrator document. Brushes are contained in documents. Table 5.3 Brush - Properties Property R/O Value type What it is Application Name Parent R/O Application object The Illustrator Application object String The Brush name R/O Document object The document that contains this Brush Table 5.4 Brush - Methods Method Returns ApplyTo(artItem As PageItem) Nothing What it does Applies the Brush to a specific art object Notes Additional brushes may be created by the user within Illustrator. Illustrator's brushes can be accessed from scripting, but cannot be created or deleted. Example 2.1 This example duplicates and groups the current selection, applying the second Brush in the document to the items in the group. Dim appRef As New Illustrator.Application Dim newGroup As Illustrator.GroupItem Dim dupItem As Object Dim artItem As Object Dim i As Integer Dim endIndex As Integer If appRef.Documents.Count > 0 Then If Not IsEmpty(appRef.ActiveDocument.selection) Then endIndex = UBound(appRef.ActiveDocument.selection) Set newGroup = appRef.ActiveDocument.GroupItems.Add For i = 0 To endIndex Set artItem = appRef.ActiveDocument.selection(i) Set dupItem = artItem.Duplicate(newGroup, aiPlaceAtEnd) appRef.ActiveDocument.Brushes(2).ApplyTo artItem Next End If End If 12 Aug 03