Adobe 26001360 Scripting Guide - Page 332
Notes, Example 20.1, Table 5.36, Gradient - Methods, Gradient - Properties
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 332 highlights
332 Table 5.35 Gradient - Properties Property R/O Value type Type AiGradientType enumeration Visual Basic Reference What it is The kind of the gradient, either radial or linear Table 5.36 Gradient - Methods Method Returns Delete() Nothing What it does Delete the object Notes Illustrator's Gradient object represents a gradient as defined in the Illustrator application. Additional gradients may be created by the user within Illustrator or via a script. Example 20.1 This example shows how you can create a new gradient and apply it as a fill pattern to the frontmost PathItem. Dim appRef As New Illustrator.Application Dim frontDocument As Illustrator.Document Dim newGradient As Illustrator.Gradient Dim locationSpecification As Illustrator.GradientStop Set frontDocument = appRef.ActiveDocument 'Create a color for both ends of the gradient Dim startColor As New Illustrator.RGBColor Dim endColor As New Illustrator.RGBColor startColor.Red = 0 startColor.Green = 100 startColor.Blue = 255 endColor.Red = 220 endColor.Green = 0 endColor.Blue = 100 'Create a new gradient 'A new gradient always have 2 stops Set newGradient = frontDocument.Gradients.Add newGradient.Name = "Gradient created from script" newGradient.Type = aiLinearGradient 12 Aug 03