LITOKARDO_BC Posted February 24, 2020 Posted February 24, 2020 Good morning to everyone, they would be so kind to support me with a routine that eliminates leader and converts them into texts. thank you very much for your attention. Attached example file. thanks MLTOTEXT.dwg Quote
LITOKARDO_BC Posted February 24, 2020 Author Posted February 24, 2020 5 minutes ago, ronjonp said: Explode? Why are you doing this? I usually explore it when I have only one multileader, but if I have 100 or more multileader it is very tedious to delete the leaders of each one of them Quote
ronjonp Posted February 24, 2020 Posted February 24, 2020 (edited) Code is not really needed but this will get your selection at least (defun c:foo (/ s) (if (setq s (ssget ":L" '((0 . "MULTILEADER")))) (sssetfirst nil s) ) (princ) ) Then in the properties palette: Edited February 24, 2020 by ronjonp Quote
lido Posted February 29, 2020 Posted February 29, 2020 Try this. (vl-load-com) (defun C:TxtMLeader (/ CDR10 CMD ENT LS_ENT) (defun CDR10 (EntData / list10) (foreach el EntData (if (= (car el) 10) (setq list10 (cons (cdr el) list10)) ) ) list10 ) ;;CDR10 (while (setq ENT (car (entsel "\nSelect MLeader entity: "))) (if (and (= (cdr (assoc 0 (entget ENT))) "MULTILEADER") (not (vl-position ENT LS_ENT)) ) (progn (vla-highlight (vlax-ename->vla-object ENT) :vlax-true) (setq LS_ENT (cons ENT LS_ENT)) (prompt (strcat "\n" (itoa (length LS_ENT)) " found")) ) ) ) (prompt (if LS_ENT (progn (setq CMD (getvar "CMDECHO")) (setvar "CMDECHO" 0) (vl-cmdf "_.UNDO" "_Mark") (mapcar (function (lambda (x / ls_pts) (setq ls_pts (CDR10 (entget x))) (vl-cmdf "_.EXPLODE" x) (mapcar (function (lambda (y / e) (if (and (setq e (ssget y)) (not (vl-position (cdr (assoc 0 (entget (ssname e 0)))) (quote ("TEXT" "MTEXT" "INSERT")))) ) (setq e (command "_.ERASE" e "")) ) ) ) ls_pts ) ) ) LS_ENT ) (vl-cmdf "_.UNDO" "_End") (setvar "CMDECHO" CMD) (strcat "\n" (itoa (length LS_ENT)) " MultiLeader entities modified") ) "\nNorthing selected." ) ) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.