Sg2.9
scale anchor?
Recent RSS
scale anchor?
Date:  13. June 2008, 22:09

Is it possible to set the location of the anchor for the scale tool/command? I see that it is possible for rotate but I don't see how to do it for scale.

I'd like to be able to scale multiple items using different anchor points for each item. Is this possible?

Thanks in advance.

Re: scale anchor?
Date:  25. June 2008, 00:36

Maybe my question was not clear, or maybe no one knows the answer?

Maybe a more concrete example is needed. Here's what I'm trying to do. I want to select multiple items and scale them all by a percentage. They should scale to their own centers, and not to the lower left corner of the document, like they are now.

Here's a useful example: let's say you needed to scale all the stars that represent cities on a map. You'd have to select each one and scale by a certain percentage just so they all stay in the same location if you were to do it without scriptographer.

Can anyone look at the script and help? I don't fully know what I'm doing. I would think that the object raster script would be the best thing to model this after, but I really don't understand how that works.

Re: scale anchor?
From:  well
Date:  25. June 2008, 08:36

i haven't looked at your script, but you can do what you want without scriptographer by doing the following:

1. Select the objects.
2. Choose Object > Transform > Transform Each.
3. Set percentages for horizontal and vertical scaling in the Scale section of the dialog box.
4. To change the reference point, click a white square on the reference point locator .
5. Click OK, or click Copy to scale a copy of each object.

Re: scale anchor?
Date:  25. June 2008, 13:03

this should do the trick:

function scalepoint() {
	array = document.getSelectedItems();
	for (var i = 0; i < array.length; i++) {
		obj = array[i];	
		var center = obj.bounds.center.clone();
		obj.scale(scaledec);		
		obj.translate(obj.bounds.center.multiply(-1).add(center));
	}
}
Re: scale anchor?
Date:  25. June 2008, 17:32

Thanks, well, for pointing out that feature! I wish I knew about it before. There's always something to learn with Illustrator.

Jonathan,
Thanks for the update to the code. It works brilliantly. I still hope to experiment and expand more with this general idea, so thanks!

Scripts
08.01.12, 08:40
08.01.12, 08:18
04.01.12, 11:04
28.12.11, 10:42
16.11.11, 09:40
28.10.11, 10:47
Posts
06.02.12, 16:27
04.02.12, 16:55
04.02.12, 16:32
04.02.12, 12:49
03.02.12, 22:33
03.02.12, 17:24
Script of the Moment
Stroke Translation 10.03.09
Donation

If you use Scriptographer regularly or for commercial purposes, please consider making a donation via PayPal:

Thank you!