Arc Leader Line lisp doesn't perform as it did.

We current are using a lisp routine that draws a leader line with a arc on the end instead of an arrow. However, when completing the lisp it draws a line out to nowhere for some reason. Not sure if it isn't compatible with BricsCAD.

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)
)

when placing pt3 the command executes pt4 off somewhere else.....

Any assistance is appreciated.

Thanks,
Jim

Comments

  • Charles Alan Butler
    edited November 2018

    No time this morning but try this
    (command ".pline" "_non" pt3 "w" 0 0 "a" "d" dir "_non" pt4 "l" "_non" pt2)

  • What is the "_non" for?
    All I get now is the command ends after pt2 is placed.

    Thank you for your response.

  • I placed "" at the end and got the single line after pt2, but otherwise it still draws a line after pt3 when it shouldn't.

    (command ".pline" "_non" pt3 "w" 0 0 "a" "d" dir "_non" pt4 "l" "_non" pt2 "")

    Thanks again.

  • Apparently the command line macro that was pointing to this lisp routine wasn't written correctly, which caused the issues. Thank you for your time.

  • To answer your question about "_non", it turns off esnaps for the next selection. You had the two lines that set esnaps commented out. Most times when input for a lisp function goes somewhere other than where you clicked the cause is a running esnap that was left on.

  • Why use a LISP routine when you could do the same with a MLEADER? Example attached.

    Regards,
    Jason Bourhill
    CAD Concepts

  • That's a very good question. The .lsp routine has been around for many years and didn't think of the Mleader.

This discussion has been closed.