Jump to content

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

Link to comment

 

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

 

Link to comment

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}
{Licensed unde the GNU Lesser General Public License}
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);

 

  • Like 1
Link to comment
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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...