Adobe 26001360 Scripting Guide - Page 396
Notes, Example 52.1, Table 5.102, PatternColor - Properties Continued
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 396 highlights
396 Visual Basic Reference Table 5.102 PatternColor - Properties (Continued) Property R/O Value type What it is ShiftDistance Double The distance to translate the unscaled prototype pattern before filling Notes Pattern colors are created using a reference to an existing pattern in the document. A matrix may be specified to further transform the pattern color. Example 52.1 This script illustrates how to modify the first pattern in a document. Dim appRef As New Illustrator.Application Dim colorOfPattern As New Illustrator.PatternColor Dim swatchRef As Illustrator.Swatch Dim swatchColor As Object Dim firstPath As Illustrator.PathItem For Each swatchRef In appRef.ActiveDocument.Swatches 'Get the color object of the swatch Set swatchColor = swatchRef.Color 'Only operate on patterns If (TypeName(swatchRef) = "PatternColor") Then 'Obtain the PatternColor from generic color object colorOfPattern = swatchColor.Pattern 'Change the pattern properties colorOfPattern.Rotation = 10 'Set the PatternColor of the original Color object swatchColor.Pattern = colorOfPattern 'Apply the color to the frontmost path Set firstPath = appRef.ActiveDocument.PathItems(1) firstPath.Filled = True firstPath.fillColor = swatchColor 'Change the definition of the pattern in the palette swatchRef.Color = swatchColor End If 12 Aug 03