garisimola wrote: I have no idea what prompted you to help the hell out of me. I'm not sure either, but it is certainly enjoyable and rewarding to see progress. Keep it going. this takes the distance (right - left), multiplies it by 10% (1.1) and then subtracts the distance (right - left)/2 leaving the amount we want to move from the left to more left (this number will be negative, yes?) Well - it will be a number LESS than the original design left VB (VisibleBound). Possibly negative, possibly not. Depends on where your existing left VB is relative to your existing artboard. Usually artboard left is zero (although than can be changed), but remember that your VBs are of your design. or is the coordinate for the right sometimes not = zero? That is correct, for reasons explained above. extrapolating your work, this is what I get for the left, right, top, and bottom calculations: var left = docVB[0] – ((docVB[2] - docVB[0])*1.1 - (docVB[2] - docVB[0]) / 2) var right = docVB[2] + ((docVB[2] - docVB[0])*1.1 - (docVB[2] - docVB[0]) / 2) var top = docVB[1] + ((docVB[1] - docVB[3])*1.1 - (docVB[1] - docVB[3]) / 2) var bottom = docVB[3] - ((docVB[1] - docVB[3])*1.1 - (docVB[1] - docVB[3]) / 2) I think that you've got it. But now-- based on your new requirements (% of LONGER dimension +1/2") we're going to change a few things up, keeping you on your toes. I hope that it will make it easier and not more confusing. Here's the new VB.NET code: Public Sub AdjustArtboardSize(app As AI.Application, abMargin As Double) Dim aDoc As AI.Document = app.ActiveDocument Dim vb = aDoc.VisibleBounds Dim width = (vb(2) - vb(0)) 'left-right Dim height = -(vb(3) - vb(1)) 'bottom-top Dim margin = Math.Max(width, height) * (abMargin / 100) / 2 + 36 '36pts = .5" vb(0) -= margin 'left vb(1) += margin 'top vb(2) += margin 'right vb(3) -= margin 'bottom aDoc.Artboards(1).ArtboardRect = vb End Sub A few notes: I've introduced a new 'margin' variable. I've taken the '1+' out of the equation, and now divide abMargin (or your desired % margin) by 100 to come up with, for example: abMargin = 10... so 10/100=.1 (you can hardcode that it you would like or create a new JS variable for the abMargin equivalent -- like: var abMargin = 10; ) and then divide that by 2 (which basically takes your 10% and applies 5% on each side). I add 36 (remember 1" = 72 Adobe points) - so that's your 1/2". 'Math.Max(width, height)' returns the greater of the two elements, thus giving you what you need for your "longer of the two) dimensions requirement. Multiply that result by the percentage calcs mentioned above and you have the consistent margin desired for each side. WIth all that said, the rest is really easy, as you just add or subtract the new "margin" from the existing VisibleBounds. So now we will be anxiously waiting your next post signalling SUCCESS! Or... we'll be happy to help you again if need be. Good luck! -TT PS: Sometimes I get on a roll and type away and then, realizing the time spent, I get lazy (or my ADD kicks in ) and don't always proofread before I post. Please forgive any typos or if something doesn't make sense. Hopefully it all does.
... View more