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.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
Cross Hatch Raster 15.03.12