Hiya gang,
I've been using the routine below from CADALYST for years. now for some reason in AutoCAD 2017 it's not working. It creates the new Mtext entity from the selected Leader and Mtext, but it's not deleting the original objects.
Also, I get the following in the command line after the command completes:
Pick Leader
Pick Text-layer
Current layer: "L-00 SWTB TEXT"
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: s
Enter layer name to make current or <select object>: L-00 SWTB TEXT Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]:
Command: mleader
Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>:
Specify next point:
Specify next point: \A1;test
Invalid Input.
Specify next point: ERASE
Invalid Input.
Specify next point:
Invalid Input.
Specify next point:
Enter text: erase
Command: <Entity name: 4B841090>
Code:
;;; CADALYST 08/08 www.cadalyst.com/code ;;; Tip 2305: LeaderToMleader.lsp Leader to Multileader (c) 2008 Lyle Hardin
;;; Pick an old style leader and text to create a new mleader entity and erase the old leader and text.
;;; March/2008
(defun c:leadertomleader ()
(setq leader (entsel "\nPick Leader") ; pick leader
leader2 (entget (car leader))
pt1 (dxf 10 leader2) ; get first point of leader
layer (dxf 8 leader2) ; get layer of leader
mtext (entsel "\nPick Text") ; pick text
mtext2 (entget (car mtext))
pt2 (dxf 10 mtext2) ; get point of text
text (dxf 1 mtext2) ; get
) ; setq
(command "-layer" "s" layer "") ; set layer of leader picked to current
(command "mleader" pt1 pt2 text) ; start mleader command
(COMMAND "ERASE" mtext "") ; erase text picked
(command "erase" leader "") ; erase leader picked
) ; defun
(defun dxf(code elist) ; define dxf function
(cdr (assoc code elist)) ;Finds the association pair, strips 1st element
);defun
Thanks as always for any help...