Code Red > AutoLISP (Vanilla / Visual)

Angle of Closed polylines elbows

(1/2) > >>

Coder:
Hello guys.
Hope you all doing well.

I am trying to get the angle of closed LWPolyline elbows, like 30,45,90 ... etc.
How to code such a routine?
Thank you.

Lee Mac:
Find the first non-zero bulge value (DXF group 42), calculate the arctangent (atan), and multiply by 4.

This will give an answer in radians, which may be converted to degrees if necessary by dividing by pi and multiplying by 180.

Coder:
Wow that's great.  :wink:

Can you please tell how does atan work and why to multiply with 4.0 and not another decimal number?

Thank you Lee for your kind help.

Coder:
I got it.  :wink:

Thanks again.

MP:
In addition to Lee’s most excellent guidance you may find this useful in your lisp journey: http://www.afralisp.net/autolisp/tutorials/polyline-bulges-part-1.php ...

Navigation

[0] Message Index

[#] Next page

Go to full version