relume Posted February 4, 2017 Share Posted February 4, 2017 Hello I have to rotate 2D objects in vectorscript/python by an individual absolute angle. With vs.HRotate the rotation is executed in relation to the actual angle - so the actual object angle value is added by the angle value set with vs.HRotate ( actual angle is for examble 30d, the angle for rotation is 45d so with HRotate the resulting angle will be 75d - but I want the object to be rotate to the absolute angle of 45d) . Is there any alternative command to set an absolute angle - e.g. set/access the object angle field directly? Many thanks in advance Quote Link to comment
JBenghiat Posted February 4, 2017 Share Posted February 4, 2017 Nope, you have to do the math. Get the existing angle and rote the object by newAngle-CurrentAngle. -Josh Quote Link to comment
relume Posted February 6, 2017 Author Share Posted February 6, 2017 Hello Josh Thank you very much - finally I went the way you proposed also. I tried also the command "vs.SetAngle" and that is the command I searched for (absolute rotation), but unfortunately this command works only on "pure" 2D Objects but not on 2D Symbols. Quote Link to comment
DomC Posted February 7, 2017 Share Posted February 7, 2017 Accidentally, we all try to solve the same problem at the same time :-) My solution: SollWinkel = 45 def DoSomething(h): if vs.GetType(h) == 15: #Symbol in Drawing x,y = vs.GetSymLoc(h) #vs.Locus(x,y) #Test Symbol insertion Point IstWinkel = vs.GetSymRot(h) Winkel = SollWinkel-IstWinkel vs.HRotate(h, x,y, Winkel) return() vs.ForEachObject(DoSomething, "SEL=TRUE") Always most difficult to find the right script commands. 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.