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

Looping problem...How to create and lock a set of PathItems?

$
0
0

Greetings all!

I'm a noob....a very confused one

And I'm trying to get this thing work

So here is what I have. The first loop grabs the geometries drawn in the current document and rotates it around itself creating duplicates. The second loop is supposed to circumvent more geometries around the newly created geometries.

But instead of creating a radiant pattern, this code builds a tower: for the second loop everytime it grabs the last drawn geometry instead of what is in the "Original"

Can somebody explain what is wrong? Thanks!

 

for NumPaths = 1 to frontDocument.PathItems.count

          set myPath = frontDocument.PathItems.item(NumPaths)

 

 

          For index = 0 To 30

                    set newPath = myPath.Duplicate

                    call newPath.translate(100*sin(6.14* index/30),100*cos(6.14* index/30))

                    call newPath.rotate(360 * index/30)

          Next

Next

 

 

Set Original = frontDocument.PathItems

 

 

for NumPaths = 1 to Original.count

          set myPath = Original.Item(NumPaths)

 

 

          For index = 0 To 30

                    set newPath = myPath.Duplicate

                    call newPath.translate(100*sin(6.14* index/30),100*cos(6.14* index/30))

                    call newPath.rotate(360 * index/30)

          Next

Next


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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