Sg2.9
Rectangle to artboard
Recent RSS
Rectangle to artboard
From:  Rene
Date:  14. January 2013, 15:14

Hi,

I'd like to know how to read the size of the active artboard and then create a rectangle on the bounds of that board.

Thanks in advance for your time and effort,

Rene

Re: Rectangle to artboard
From:  Rene
Date:  14. January 2013, 15:37

Okay,

Found something in the forum that helped me out and this does the trick:

var myArtboard=document.activeArtboard;

var mabsize = myArtboard.bounds

var rect=new Path.Rectangle(new Point(0,0),new Point(mabsize));

  • --

I know what I want, but it is the syntax of the java that I still need to lean.

Thnx!

Re: Rectangle to artboard
From:  Tanvir
Date:  9. August 2014, 18:40

Artboards are a unique and powerful feature of Illustrator. The artboard works just like a piece of paper would on a physical desk. For example, if you were creating a collage, you could put elements you are not currently using on your desk outside of the bounds of the paper. They are still close for easy access, but they don’t interfere with the artwork taking shape on the document. Illustrator works in a similar way.

When you create a new document, you have an artboard in the middle of a large workspace. Any graphics you place on the artboard itself will appear in the final design. Anything outside its bounds will not appear when you print, export, or save as a PDF. It’s a great way to keep all of your assets in one file rather than scattered across separate files on your hard disk, or in hidden layers that become hard to manage. What’s even better is that you can have multiple artboards in one Illustrator document. You’ll find this feature very powerful when you’re creating user interfaces or building website designs, because it lets you keep an entire site in one file.

Tanvir Hossain

Re: Rectangle to artboard
From:  Bob138
Date:  12. September 2014, 21:16

Here you go.

var workingDoc = app.activeDocument;
workingDoc.selection = null;
workingDoc.defaultFillColor = workingDoc.swatches["[None]"].color;
workingDoc.defaultStrokeColor = workingDoc.swatches["[None]"].color;
var artBoardRectangle = workingDoc.pathItems.rectangle(workingDoc.height, 0, workingDoc.width, workingDoc.height, false);

Bob

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Gearwheels 18.08.08