Sg2.9
Artboard Position
Recent RSS
Artboard Position
From:  Ray Roddis
Date:  21. February 2012, 15:39

Hello again,

I'm trying to change the position of the artboard on a document I've drawn some objects on. If I change the first zero (the x coord) the artboard does move, but when I change the second 0 (the y coord) to move the artboard up, the value changes on the artboard info, but the artboard itself doesn't move.

Thanks,

Ray

var myArtboard = document.activeArtboard;
myArtboard.bounds = Rectangle([0, 0, (artWidth / 2) + 350, (artDepth / 2) + 300]);

Re: Artboard Position
From:  pqbd
Date:  22. February 2012, 00:43

Hmm. The following works fine for me:

var myArtboard=document.activeArtboard;
var rect=new Rectangle(new Point(0,0),new Point(1500,500));
myArtboard.bounds=rect;
//succeeds
myArtboard.bounds = Rectangle([0, 0, (myArtboard.bounds.width/ 2) + 350, (myArtboard.bounds.height/ 2) + 300]);
//succeeds

Are you sure you are passing a valid rectangle?

Re: Artboard Position
From:  Ray Roddis
Date:  22. February 2012, 09:54

Hello - thanks for the quick reply.

I've tried both your methods and they do change the size of the artboard no problem.

However, it's the artboard position that still refuses to budge vertically. I tried changing the xx and yy on your code; the xx move the position fine, but the yy still won't budge.

"= Rectangle([xx, yy, (myArtboard" etc.

I tried:

Rectangle([500, 500, (myArtboard.bounds.width/ 2) etc.

The result was the artboard position moved to the right 500pt, but didn't move either up or down.

I'm running Mac OS 10.5.8 and Illy CS4.

Cheers,

Ray

Re: Artboard Position
From:  pqbd
Date:  23. February 2012, 00:53

Yeah, that's pretty odd. Does it work if you pass points as the Rectangle constructor instead of x,y,w,h?

Re: Artboard Position
From:  Ray Roddis
Date:  23. February 2012, 09:07

Bit more info; I had been running the script on a new document each time, and was getting the same problem.

I tried re-running the script on the same document, and it works fine.

Thanks for the help.

Ray

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
The Allineatorium 15.05.14