socacidan Posted September 26, 2023 Share Posted September 26, 2023 On 1/17/2019 at 1:39 PM, marko_ribar said: Here is that code without BBCode Tags : (defun c:mt (/ cEnt mEnt) (if (and (setq cEnt (car (nentsel "\nSelect Source Text: "))) (member (cdr (assoc 0 (entget cEnt))) '("TEXT" "MTEXT" "ATTRIB"))) (progn (redraw cEnt 3) (while (and (setq mEnt (car (nentsel "\nSelect Destination Text: "))) (member (cdr (assoc 0 (entget mEnt))) '("TEXT" "MTEXT" "ATTRIB"))) (entmod (subst (assoc 1 (entget cEnt)) (assoc 1 (entget mEnt)) (entget mEnt)))) (redraw cEnt 4)) (princ "\n<!> Incorrect Selection <!>")) (princ)) (defun c:mt2 (/ cEnt mEnt sLst) (if (and (setq cEnt (car (nentsel "\nSelect Source Text: "))) (member (cdr (assoc 0 (entget cEnt))) '("TEXT" "MTEXT" "ATTRIB"))) (progn (redraw cEnt 3) (if (setq ss (ssget "_X" '((-4 . "<NOT") (0 . "TEXT,MTEXT,INSERT") (-4 . "NOT>")))) (mapcar '(lambda (x) (redraw x 2)) (setq sLst (mapcar 'cadr (ssnamex ss))))) (while (and (setq mEnt (car (nentsel "\nSelect Destination Text: "))) (member (cdr (assoc 0 (entget mEnt))) '("TEXT" "MTEXT" "ATTRIB"))) (entmod (subst (assoc 1 (entget cEnt)) (assoc 1 (entget mEnt)) (entget mEnt))))) (princ "\n<!> Incorrect Selection <!>")) (command "_regenall") (princ)) (defun c:mt3 (/ cEnt ss) (vl-load-com) (if (and (setq cEnt (car (nentsel "\nSelect Source Text: "))) (member (cdr (assoc 0 (entget cEnt))) '("TEXT" "MTEXT" "ATTRIB"))) (progn (redraw cEnt 3) (if (setq ss (ssget '((0 . "TEXT,MTEXT")))) (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (entmod (subst (assoc 1 (entget cEnt)) (assoc 1 (entget x)) (entget x)))))) (princ "\n<!> Incorrect Selection <!>")) (command "_regenall") (princ)) HTH., M.R. Hello, Is possible to have this lisp to make also -match field to field - and - match text, mtext to field- ? Quote Link to comment Share on other sites More sharing options...
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.