Skip to main content
sebd75331243
Known Participant
December 5, 2015
Answered

multiple artboards for multiples vectors arts ?

  • December 5, 2015
  • 1 reply
  • 1469 views

Is there a way to get random artwork in a document to have an artboard generated for each of theses artworks ?


It's obvious situation when you have vector stuff equally distributed, but if they are randomly distributed ?

Can illustrator know where to put an artboard below each artwork that is group ?

Anybody has this problem before ?

This topic has been closed for replies.
Correct answer Qwertyfly___

So this mean I have to group everything I do and I'll be alright with your script ?


here is a more complete script

this will deal with items not in groups.

will cancel if no docs open

will alert and exit if final artboard count exceeds 100.

will remove any existing artboards

will keep global space cleaner as it is bundled in a function

function make_artboards(){

    // written by Qwertyfly

    // this may not work as expected if art contains Clipping paths

    if(app.documents.length==0){return;}

    var doc = app.activeDocument;

    var grps = doc.pageItems;

    var abs = doc.artboards;

    var c = 0;

    for(var i=0; i<grps.length; i++){

        if(grps.parent.typename == "Layer"){

            c++

        }

    }

    if(c<=100){

        for(var i=1; i<abs.length; i++){

            abs.remove();

        }

        for(var i=0; i<grps.length; i++){

            if(grps.parent.typename == "Layer"){

                //this one needs an artboard

                var box = grps.visibleBounds;

                // this line is just to give the artboard some white space around the art

                box[0] = box[0]-10; box[1] = box[1]+10; box[2] = box[2]+10; box[3] = box[3]-10;

                var AB = doc.artboards.add(box);

                if(!i){abs[0].remove();}

            }

        }

    }else{

        alert(c + " is too many items, max of 100 artboards per document");

    }

}

make_artboards();

1 reply

CarlosCanto
Community Expert
Community Expert
December 5, 2015

it could be scripted, manually is easily done as well

1. select your art

2. Ctrl+C to copy it, Ctrl+F to make a copy in front

3. Effect->Convert to Shape->Rectangle

4. Object->Expand Appearance

5. Object->Artboards->Convert to Artboards

sebd75331243
Known Participant
December 7, 2015

gee man! I've been doing illustrator for almost 20 years and I never seen this 'convert to shape' rectangle feature ! wow !

Thank Carlos for this valuable input !!!

Silly-V
Legend
December 7, 2015

If you have to do this often, you can even record it into an action, but you'll have to save your "convert to shape" effect as a graphic style first, and have it present in the document so that the action can record the application of the graphic style. Or you could just insert the effect menu item using the insert command, and use the effect's dialog every time to manually set the buffer.