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

Get the Absolute angle

3 REPLIES 3
Reply
Message 1 of 4
cadking2k5
214 Views, 3 Replies

Get the Absolute angle

When you draw a line you pick a point, then you can move the crosshairs at any angle and just type in the distance and it will draw the line at that distance and the and the Crosshairs was at. is there any was to get that angle from the first point and the point of the crosshairs was just setting and was never clicked in on autolisp
3 REPLIES 3
Message 2 of 4
stevor
in reply to: cadking2k5

In autolisp, Grread will report data that can be used to evaluate the angle.
S
Message 3 of 4
stevor
in reply to: cadking2k5

An example of Grread is in: Kent1Cooper Re: Script to create a temporary cursor 10-31-2014 07:53 PM http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-create-a-temporary-cursor/t...
S
Message 4 of 4
stevor
in reply to: cadking2k5

Dragged out of the past;

modify to your app:

 

 ; display color Cn line from Pr to cursor, angle
 (defun Grr_Ang ( pr ps rd cn / gl A1 A2 Tn pt) ; SCG-2nov14
   (setq Tn 1   A1 0 )    (princ ps) ; prompt string
   (while (/= Tn 3)  ; 4 is not rqd
    (setq gl (grread T 4)  Tn (car gl)  pt (cadr gl)
          A2 (angle Pr Pt ) )
    (if (not (equal A1 A2 rd )) ; no 0-360 discrim
     (progn
      (command "redraw") (grdraw pr pt cn )
      (setq A1 A2) (princ"\n A: ")(princ (angtos A2))
     )
    )
   ) ; w
   (redraw) (princ "\n done: ") (princ (angtos A2))
   (list a2 pT)
  ) ; def
 
  (setq psr (list 0 0) ) ; or your own ref point
  (if (setq rl (Grr_Ang psr "\n Point to Angle: " 0.01 7))
    (progn (redraw) (grdraw psr (cadr rl) 1)
      (princ"\n Angle: ")(princ (angtos (car rl) ))
   )
  )

S

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

Post to forums  

Autodesk Design & Make Report

”Boost