Sg2.0
scale anchor?
Recent RSS
scale anchor?
From:  mikeb
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?
From:  mikeb
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?
From:  Jonathan
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?
From:  mikeb
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
13.10.08, 01:28
03.10.08, 00:01
18.09.08, 20:43
16.09.08, 21:36
14.09.08, 18:50
Posts
19.11.08, 18:10
18.11.08, 19:27
18.11.08, 19:07
18.11.08, 06:05
18.11.08, 03:30
Interactive Tools 16.06.06
If you use Scriptographer regularly, please consider making a donation via PayPal: $$$ €€€ £££ CHF