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

duplicating multiple groups?

$
0
0

Hello all,

 

I am attempting to develop a script where i have a selection of a group and it would duplicate twice along the x axis.  Then, take all the grouped items and duplicate it down the y axis 3x. 
This is what i have so far:

 

 

 

var myDoc = app.activeDocument;

var myNeckLabel = myDoc.selection[0];

 

// For loop duplicating selection, moving to the left 2x

for (var sel=0; sel<[2]; sel++){

  myNeckLabel.duplicate();

  myNeckLabel.translate(-3.9327*72);

}

 

// For loop duplicate selection down 3x

for (var sel=0; sel<[3]; sel++){

  myNeckLabel.duplicate();

  myNeckLabel.translate(0,-3.153*72);

}

 

 

What the above produced for me is the desired effect, except it will only do it down the left column, so i would have the top row and the left column filled out. how do i select every object the first loop creates and then feed it into the second loop?
Thanks for the help in advance !


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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