.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Editor.GetAngle

6 REPLIES 6
Reply
Message 1 of 7
NilsL
955 Views, 6 Replies

Editor.GetAngle

Is there a way to have the GetAngle function to return angles based on Angdir?

No matter what I try, returned angles are always counterclockwise.

I have a drawing where 0 degrees is due north and then I want the angles to be measured positive clockwise.

Thanks,
Nils Lundstrom
6 REPLIES 6
Message 2 of 7
MarkPendergraft
in reply to: NilsL

In the math world, angles are always turned counter clockwise with zero being right (east).

That being said. I don't know of a way to change the editor.getangle function.

However with some very simple math you can convert the angles to clockwise measurements from due north (ahhhhhh the glorious north azimuth).

to convert: subtract your angle from 360° and add 90°.
360-angle+90 = clockwise angle
if the clockwise angle is over 360 degrees, (it has made the full circle and then some) then just subtract 360°.

of course the angle given to you from the editor function is in radians so you will either need to convert the angle to degrees or substitute 360° with 2*pi and 90° with pi/2

And there is your answer.

ps. you can create a variable named pi and set it equal to system.math.pi for increased accuracy.
Message 3 of 7
NilsL
in reply to: NilsL

Thanks Cadkid,
thats actually what I'm doing at the moment.

What's the use of ANGDIR and ANGBASE then, if it is not used in the picking process?

Well, perhaps I could refine the function a bit to actually check these two variables and do the math based on that.

regarding your ps, is there a significant speed gain in using a variable instead of just System.Math.pi. ?
Message 4 of 7
MarkPendergraft
in reply to: NilsL

ANGDIR and ANGBASE appear to be global variables controlling the drawings units. if you type UNITS you will see that you can specify 'clockwise' in the angle frame, and if you click the direction button you can specify which direction you would like 0 to be... east (default) or north..

as far as saving time by assigning it to a variable. the answer is no, in fact it slows you down.... however "pi" is easier to type than system.math.pi

i was just suggesting that you use the sytem.math.pi instead of just rounding to a couple decimal places like 3.1416
Message 5 of 7
Anonymous
in reply to: NilsL

Have you tried setting the UseAngleBase property
of the PromptAngleOptions object ?

If you set this property to true, the underlying code
will use acedGetOrient() rather than acedGetAngle().

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5555508@discussion.autodesk.com...
Is there a way to have the GetAngle function to return angles based on Angdir?

No matter what I try, returned angles are always counterclockwise.

I have a drawing where 0 degrees is due north and then I want the angles to be measured positive clockwise.

Thanks,
Nils Lundstrom
Message 6 of 7
NilsL
in reply to: NilsL

Thanks Tony,

yes, I did try that, but I think, or at least the returns seem to inducate that it does exactly what the name implies, use ANGBASE but not ANGDIR. Can you confirm this ?

/Nils
Message 7 of 7
Anonymous
in reply to: NilsL

UseAngleBase = true causes acedGetAngle() to be used.

UseAngleBase = false causes acedGetOriented() to be used.

In either case, the behavior should be consistent with the
underlying API function, so compare the result with the
result you get from calling the LISP (getangle) function.

UseAngleBase is true by default in PromptAngleOptions, so
if you want

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5558729@discussion.autodesk.com...
Thanks Tony,

yes, I did try that, but I think, or at least the returns seem to inducate that it does exactly what the name implies, use ANGBASE but not ANGDIR. Can you confirm this ?

/Nils

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost