Arc Leader Line lisp not functioning as expected

Arc Leader Line lisp not functioning as expected

jstogdill
Explorer Explorer
953 Views
4 Replies
Message 1 of 5

Arc Leader Line lisp not functioning as expected

jstogdill
Explorer
Explorer
We have a .lsp that was written several years ago and is now not working as it use to. This routine draws a pline from a specific point with a arc or loop on the end instead of an arrow. For some reason when you place "pt3" on the drawing "pt4" places automatically drawing a line instead of canceling the command. Here is the routine; (defun rtd (a) (/ (* a 180.00) pi) ) (defun c:aldr (/ multi lth dir pt1 pt2 pt3 pt4 ) (setq multi(getvar "dimscale")) (setq lth (* 0.0625 multi)) ;(command "osnap" "nea") (setq pt1 (getpoint "\nLeader start: ")) ;(command "osnap" "off") (setq pt2 (getpoint pt1 "\nNext point: ")) (setq dir (+ 90.0 (rtd (angle pt1 pt2)))) (setq pt3 (polar pt1 (angle pt1 pt2) lth)) (setq pt4 (polar pt1 (angle pt2 pt1) lth)) (command ".pline" pt3 "w" 0 0 "a" "d" dir pt4 "l" pt2) )
0 Likes
Accepted solutions (1)
954 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant

This works good to me.

Not sure whether you want the PLINE keep running or finish. Then remove or keep the last "".

 

(defun rtd (a)
  (/ (* a 180.00) pi) )

(defun c:aldr (/ multi lth dir pt1 pt2 pt3 pt4 )
  (setq multi(getvar "dimscale"))
  (setq lth (* 0.0625 multi))
  ;(command "osnap" "nea")
  (setq pt1 (getpoint "\nLeader start: "))
  ;(command "osnap" "off")
  (setq pt2 (getpoint pt1 "\nNext point: "))
  (setq dir (+ 90.0 (rtd (angle pt1 pt2))))
  (setq pt3 (polar pt1 (angle pt1 pt2) lth))
  (setq pt4 (polar pt1 (angle pt2 pt1) lth))
  (command ".pline" "_non" pt3 "w" 0 0 "a" "d" dir "_non" pt4 "l" "_non" pt2 "")
  (princ))

 

0 Likes
Message 3 of 5

jstogdill
Explorer
Explorer

Thank you for responding.....  This still isn't working correctly on my end.  It still sends a line off to nowhere when placing pt3....

 

If I remove the quotes "" at the end I only get a single line with the loop.

0 Likes
Message 4 of 5

ВeekeeCZ
Consultant
Consultant

Do you have set UNITS to degrees?

0 Likes
Message 5 of 5

jstogdill
Explorer
Explorer
Accepted solution

The culprit turned out to be the command line for the ribbon button.  All is good now and thanks for the assistance..

0 Likes