Grenco Posted November 11, 2009 Posted November 11, 2009 ... it isn't set! In my mnl file i got the following variables set: (setvar "POLARANG" 90) (setvar "AUTOSNAP" 63) With VBA (wich automaticly runs when autocad is started) I do it again!: ThisDrawing.SetVariable POLARANG, 90 ThisDrawing.SetVariable AUTOSNAP, 63 You should think that my polar now ON and the angle is set to 90 degrees except the polar angle is 116.620156177409!?!?! I think this value comes from rad? But I don't care... I want to preset that polar is ON and the angle is 90! If I correct it manually the value 116.xx disappears and 90 is set, it works fine then. When I close autocad and restart it. The value 116.xx is back as polarangle! Someone has an idea to fix it?? Quote
BIGAL Posted November 12, 2009 Posted November 12, 2009 Its probably your "units" conflicting with the setvar when units are set to degrees then keyboard 90 else if radians then 1.57..... In this case I would bet the setvar polarang is always in radians. Lots of stuff must always be in radians when programming it ignores the UNITS settings. Quote
Grenco Posted November 12, 2009 Author Posted November 12, 2009 Thnx! For a correct value for RAD I've done the following: Dim Pi As Double Pi = Atn(1) * 4 Ang = Pi / 2 ThisDrawing.SetVariable "POLARANG", Ang Quote
erratic Posted September 26, 2011 Posted September 26, 2011 was an easy solution ever found for this pain is the a** issue??? Quote
BIGAL Posted September 27, 2011 Posted September 27, 2011 Further to above Erratic Always!!! work in radians not degrees then no problems this has been with Autocad since day dot, also the angle set it to say 0 via units up, no its still to right. 90=1.570796 or set a variable pi90 etc generally only need 4 0 1.570796 3.141593 3.92699 This is the easy solution. Quote
erratic Posted September 27, 2011 Posted September 27, 2011 I won't deny that you just passed along an easy fix, but it may has well have been in Chinese as it doesn't help me much. But thank you. Quote
Lee Mac Posted September 27, 2011 Posted September 27, 2011 What are you trying to do erratic? When setting the POLARANG System variable programmatically, it will take a value in Radians, so you will need to convert your Degrees to Radians. Here is a simple function to help you: (defun SetPolarAng ( x ) (setvar 'POLARANG (* pi (/ x 180.))) ) Call with angle in degrees, eg; (SetPolarAng 90.0) Quote
BIGAL Posted September 28, 2011 Posted September 28, 2011 Majority of dwg's are at square angles so you only need to know the 4 radian values 0 1.570796 3.141593 3.92699 = 0 90 180 270 then as per LEE just use a Degrees to radians DTR, backwards = RTD these are old lisps been around for ever and would normally be located in your startup lisp so they are ready to use in any other program. (defun dtr (a) (* pi (/ a 180.0)) ) ; (defun rtd (a) (/ (* a 180.0) pi) ) Quote
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.