Display full version of the post: multiline text to multileader conversion

Betinka
01.09.2011, 08:47
Hi,I'm trying to find routine that will change my MTEXT to MLEADER. I have found sth common on autodesk discussion group:[code]; MTXT.LSP Match Text updated to use mleaders
;; Match Text, pick text with desired text value, then
;; pick text to be changed.
;=========================================================
(defun C:MTXT ( / edata edata1 etype etype1 EL CVALUE EN BN)
(setq EL (entget (car (nentsel "\nPick Text (From)...")))
etype (cdr (assoc 0 EL)))
(setq EN (car (nentsel "\nPick Text (To)....."))
edata1 (entget EN)
etype1 (cdr (assoc 0 edata1)))

(cond ((and (= etype "MULTILEADER") (= etype1 "MULTILEADER")) (setq CVALUE (cdr (assoc 304 EL))
BN (entget EN)
BN (subst (cons 304 CVALUE) (assoc 304 BN) BN));setq
(entmod BN)
(entupd EN))
((and (= etype "MULTILEADER") (or (= etype1 "TEXT") (= etype1 "MTEXT"))) (setq CVALUE (cdr (assoc 304 EL))
BN (entget EN)
BN (subst (cons 1 CVALUE) (assoc 1 BN) BN));setq
(entmod BN)
(entupd EN))
((and (or (= etype "TEXT") (= etype "MTEXT")) (= etype1 "MULTILEADER")) (setq CVALUE (cdr (assoc 1 EL))
BN (entget EN)
BN (subst (cons 304 CVALUE) (assoc 304 BN) BN));setq
(entmod BN)
(entupd EN))
((and (or (= etype "TEXT") (= etype "MTEXT")) (or (= etype1 "TEXT") (= etype1 "MTEXT"))) (setq CVALUE (cdr (assoc 1 EL))
BN (entget EN)
BN (subst (cons 1 CVALUE) (assoc 1 BN) BN));setq
(entmod BN)
(entupd EN))
);cond
)[/code]What this routine do is:1. you have to select MTEXT to collect text2 you have to select MLEADER to paste text.and that's itBut what I really want is that after selecting MTEXT leader line will immediadetly "grow" from the MTEXT and I will just have to place leader line in proper position. So I want to substitute MTEXT with MLEADER "in place".Does anybody can help?