Sg2.9
Script to Rotate selected obj...
Recent RSS
Script to Rotate selected object around a set point
From:  Ronald Stepp
Date:  20. July 2013, 02:06

I am trying to rotate selected objects around a specific defined point. Is it possible to write a script that:

1. assuming rotate tool is active
2. remember the selected objects
3. sets the rotation origin point to some value defined in the script
4. allow me to drag/rotate the newly selected objects.

I hope I am making any sense whatsoever. I just hate it when I rotate something, select another object and the rotation point gets reset, arg. I just have no way right now to remember where I had laboriously positioned the rotation point which has a nasty habit of forgetting and resetting it back to the center of the object that is selected. You would THINK there would be a command combo or a way to tell it to choose from a list of the previous 2 or 3 positions by now.

Has anyone out there perhaps developed a plugin that gives more control over setting, remembering, and managing stuff like that?

Re: Script to Rotate selected object around a set point
Date:  21. July 2013, 18:15

If I had that to do, without a script, I would either move the ruler origin to the desired rotation point or place a '+' shape and lock it. Then I have an easy place to find!
It looks easy enough to produce a script that rotates selected objects about specified x/y , page origin, ruler origin .... but I don't think there is a way to remember/set a user dragged rotation point. I looked at Illustrator's own scripting and can't find anything there either.

Re: Script to Rotate selected object around a set point
From:  pqbd
Date:  26. July 2013, 21:29

I don't believe that Sg can tell which native tool is active. Moreover, it cannot set the rotation origin of the rotate tool. You'll need to write an Sg tool that has the behavior you want.

You can get/set a point by storing it in the object.data.point value. This only works for individual objects and groups. If you need to recall sets of items and multiple rotation points, you'll need something more complex.

You could store the names of objects of sets as a string in the document.data.string value, and parse it into an array.

Re: Script to Rotate selected object around a set point
Date:  27. July 2013, 12:01

Try this quick script
will rotate about selection centre, chosen point, ruler or artboard

Now edited to use scriptographer tool to click the rotation point and drag to set the rotation; and to remember the settings from last use in preferences

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
Stroke <-> Fill 09.01.08