# ROTATION OF MULTIPLE 2D OBJECTS IN PLACE

## Recommended Posts

So isn't there a way or a script where one can have many 2d objects selected and then rotate them all to a certain degree in their individual places (rather than rotating the whole like it would be a group)?  I thought I saw this years ago but can't seem to find it.

Thanks

bc

The script in this thread will rotate selected objects about their centers. Written for VW2007.  Tested once in VW2023. Use at your own risk. 😉

THANKS PAT,  couldn't get them to work. Tried three different ones including your rotate. This is being tried in 2021.

Maybe I'm not copying them correctly? Although one of them DID rotate but only to 90 degrees, rather than a specified degree.

Maybe you could please repost only the one that your are referring to that works and at least eliminate that variable?

Super thanks.

bc

Try this.  Copy and paste only what is in the code block below into a new blank Vectorscript editor window.  Make sure it is set to Language: Vectorscript at the top and not to Python.

Select one or more objects and run the script. You should get a dialog box asking for the angle to rotate and each object should rotate around it's center.  Actually it is probably the center of the bounding box, so if you have oddly shaped objects it might not work as you want.

HTH.  Ask again if it does not work.

```Procedure RotateEachObject;
{Rotates each selected object in the active layer}
{Symbols and PIOs are rotates around the insertion point}
{Other Objects are rotated around their center point}
{? 2007,2008, Coviana, Inc - Pat Stanford pat@coviana.com}
Var H1,H2:Handle;
N1,N2:Integer;
A1:Dynarray[ ] of handle;
R1,X1,Y1 :Real;
Begin
N1:=Count(Sel);
If N1>0 then
Begin
Allocate A1[1..N1];
N2:=1;
While N2<=N1 do
Begin
A1[N2]:=FSActLayer;
SetDSelect(FSActLayer);
N2:=N2+1;
End;
R1:=RealDialog('Enter the amount to rotate each object by','90.0');
N2:=1;
While N2<=N1 do
Begin
If ((GetType(A1[N2]) = 15) or (GetType(A1[N2])=86)) then
GetSymLoc(A1[N2],X1,Y1)
else
HCenter(A1[N2],X1,Y1);
HRotate(A1[N2],X1,Y1,R1);
N2:=N2+1;
End;
End
else AlrtDialog('At least one object must be selected');
End;
Run(RotateEachObject);```

24 minutes ago, Pat Stanford said:

It works for the 90º default but when I enter a different number it just sounds out an error beep and when I cancel it, it rotates 90.

thanks

OK I don't know what happened but now it is working....so it seems.

Than ks again Pat. This will be a real time saver

Edited by bc

The dialog box is looking for a number, so don't put any unit mark in. Just type in the number of degrees.  Anything beside a number, including an extra space potentially, will cause the problem you stated.

Glad it is working now and hope it helps.

will be a chance that one day this script will be turned  in setting of the rotate tool ?

michaelk wrote this for me in 2014, it enabled me to produce nice simple semi-random planting plans.

9 hours ago, Ben59 said:

will be a chance that one day this script will be turned  in setting of the rotate tool ?

I suggest you make a post in the Wishlist forum suggesting that a mode be added to the Rotation Tool to rotate multiple selected objects around there individual centers. That would be the most likely way to get this on the feature request list.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×

• KBASE
• #### MARIONETTE

×
• Create New...