bc Posted January 24, 2023 Share Posted January 24, 2023 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 Quote Link to comment
Pat Stanford Posted January 24, 2023 Share Posted January 24, 2023 The script in this thread will rotate selected objects about their centers. Written for VW2007. Tested once in VW2023. Use at your own risk. 😉 Quote Link to comment
bc Posted January 24, 2023 Author Share Posted January 24, 2023 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 Quote Link to comment
Pat Stanford Posted January 24, 2023 Share Posted January 24, 2023 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); 1 Quote Link to comment
bc Posted January 24, 2023 Author Share Posted January 24, 2023 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 Quote Link to comment
bc Posted January 24, 2023 Author Share Posted January 24, 2023 (edited) 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 January 24, 2023 by bc Quote Link to comment
Pat Stanford Posted January 25, 2023 Share Posted January 25, 2023 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. 2 Quote Link to comment
Ben3B Posted January 25, 2023 Share Posted January 25, 2023 will be a chance that one day this script will be turned in setting of the rotate tool ? 1 Quote Link to comment
unearthed Posted January 25, 2023 Share Posted January 25, 2023 michaelk wrote this for me in 2014, it enabled me to produce nice simple semi-random planting plans. Quote Link to comment
Pat Stanford Posted January 25, 2023 Share Posted January 25, 2023 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. Quote Link to comment
Recommended Posts
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.