Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need help finding angle

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
210 Views, 5 Replies

Need help finding angle

Hello,

In the attached image, I'm trying to find the DIRECTION (not angle) picked
by a user. The angle from A to B is already known. The user is picking a
point that may be in any direction and I'm trying to determine if the pick
is on one side of the known angle or the other . I've tried some
simple arguments without correct result.


(if (and
(> ROTRAD (+ ROTRAD 0.00001) ) ;just barely more than ROTRAD
(< ROTRAD (+ ROTRAD 3.45558) ) ;just barely less than ROTRAD =180%%d
)
(alert "Y")
(alert "Z")
)

Any help would be greatly appreciated.
Mark
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

 
Message 3 of 6
tensuns
in reply to: Anonymous

If I understand you right, your trying to do something like the side input of the offset command. I do something similar in my routine that draws A/C pads. The solution I found is to calculate the 'signed area' (you can do a search to get a description of what that means). I've attached the main function I use. The value it returns is positive for one side, and negative for the other.

In your example you would use it like this:
(SETQ signed_area (#trg_parea (list A B Y)))
And then test if the value for signed_area is positive or negative.
Message 4 of 6
Anonymous
in reply to: Anonymous

Hi Mark,

This thread also could be of interest for you:

http://discussion.autodesk.com/thread.jspa?messageID=5264777

Constantin

"Mark Ingram" a écrit dans le message de news:
5271781@discussion.autodesk.com...
Hello,

In the attached image, I'm trying to find the DIRECTION (not angle) picked
by a user. The angle from A to B is already known. The user is picking a
point that may be in any direction and I'm trying to determine if the pick
is on one side of the known angle or the other . I've tried some
simple arguments without correct result.


(if (and
(> ROTRAD (+ ROTRAD 0.00001) ) ;just barely more than ROTRAD
(< ROTRAD (+ ROTRAD 3.45558) ) ;just barely less than ROTRAD =180%%d
)
(alert "Y")
(alert "Z")
)

Any help would be greatly appreciated.
Mark
Message 5 of 6
Anonymous
in reply to: Anonymous

Excellent, thank you. This place never ceases to amaze me.
Mark


wrote in message news:5271829@discussion.autodesk.com...
If I understand you right, your trying to do something like the side input
of the offset command. I do something similar in my routine that draws A/C
pads. The solution I found is to calculate the 'signed area' (you can do a
search to get a description of what that means). I've attached the main
function I use. The value it returns is positive for one side, and negative
for the other.

In your example you would use it like this:
(SETQ signed_area (#trg_parea (list A B Y)))
And the
n test if the value for signed_area is positive or negative.
Message 6 of 6
Anonymous
in reply to: Anonymous

Thank you Constantin.
Mark


"Constantin Gherasim" wrote in message
news:5271929@discussion.autodesk.com...
Hi Mark,

This thread also could be of interest for you:

http://discussion.autodesk.com/thread.jspa?messageID=5264777

Constantin

"Mark Ingram" a écrit dans le message de news:
5271781@discussion.autodesk.com...
Hello,

In the attached image, I'm trying to find the DIRECTION (not angle) picked
by a user. The angle from A to B is already known. The user is picking a
point that may be in any direction and I'm trying to determine if the pick
is on one side of the known angle or the other . I've tried some
simple arguments without correct result.


(if (and
(> ROTRAD (+ ROTRAD 0.00001) ) ;just barely more than ROTRAD
(< ROTRAD (+ ROTRAD 3.45558) ) ;just barely less than ROTRAD =180%%d
)
(alert "Y")
(alert "Z")
)

Any help would be greatly appreciated.
Mark

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

Post to forums  

Autodesk Design & Make Report

”Boost