Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Creating shapes using SetEntirePath

$
0
0

Hi guys,

 

I've been trying unsuccessfully to create lines using data from Excel by using the SetEntirePath method. I just cannot figure out the correct syntax.

 

The template I was starting from is this Excel VBA macro:

Sub generateshape()
    Dim iapp As New Illustrator.Application
    Dim idoc As Illustrator.Document

    Dim isquare As Illustrator.PathItem

    Set idoc = iapp.ActiveDocument

    Set isquare = idoc.PathItems.Rectangle(200, 200, 100, 100)
   
    Set isquare = Nothing
    Set idoc = Nothing
    Set iapp = Nothing

End Sub

 

But I don't want to create a square but simply a line by using data from cells in Excel. How do I do that? I always get an "argument is not optional" error when using for example:

Dim ipath As Illustrator.PathItem

(...)

Set ipath.SetEntirePath = ([[0, 0], [100, 100]])

 

Thanks!


Viewing all articles
Browse latest Browse all 12845


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>