Curve leader on unique layer - LISP

I have a LISP routine (no idea where from) that draws curved leaders.
I draw them on unique layer and assume it is a simple matter to change the LISP to draw on a layer of my choosing.

I've pasted the LISP below (assume it shows when I post this.

Could someone kindly suggest addition to this routine that would insert said leader on "layer of choice"

regards

(defun C:CL ( / pt ptlst)
(setq ptlst (list (setq pt(getpoint "\nStart of leader.."))))
(command "._pline" pt)
(while pt (setq pt (getpoint pt "\nNext leader point.."))
(if pt (setq ptlst (append ptlst (list pt))))
(command pt)
)
(command "_.erase" "L" "")
(command "_.LEADER" ptlst "" "" "_n")
(setq en1 (entlast))
(setq ed (entget en1))
(setq ed (subst (cons 72 1) (assoc 72 ed) ed ))
(entmod ed)
)


Comments

  • If the layer will always be the same replace the last three lines with text (starting with '(setq ed (entget en1))') with the following.  Change the 0 in the last line to the layer name you want the leader moved to, keeping the quotation marks.

    ;(setq ed (entget en1))
    ;(setq ed (subst (cons 72 1) (assoc 72 ed) ed ))
    ;(entmod ed)
    (vle-entmod 72 en1 1)
    (vle-entmod 8 en1 "0")
  • Very many thanks Martin.
    It is perfect.
    Yes. Much appreciated indeed.

    I looked at another LISP that placed offset lines lines onto my layer of choosing but it got beyond me so gave up.
  • Happy to help.
  •  I have a different approach.  Rather than LISP, I simply use a macro that I put into a button, on the command field.

    ^c^c_dimleader;\\_format;_spline;_exit;

    It will create the leader formatted as a spline. It will be done in what ever the current dimension style is, and the current layer.  If you don't want text, simply press Esc any time along the way.

    -Joe
  • Thanks Joe
    Sounds good - I'll have a play with that.  I've never used Macros. New experience.
    regards
  • Oh! Is that available in 64 bit? Macro ie.
  • A macro is simply a series of commands, as though you typed them from the command line.  So, any thing you can do from your keyboard, you can put into a macro. Since you use knowledge you may already have about the commands, it is easier to do than programming in LISP.

    I know sometimes the word "macro" is used to refer to a Visual Basic routine. But, I am talking about the above, which does not involve programming.

    There are a few special codes, like the ^c [to indicate a Control-C keypress] is to cancel any current command you are in.  It is repeated, because some commands take a few extra ^c to back out of the command. Then, any space or ; is the same as pressing enter.

    -Joe
This discussion has been closed.