mahmoudqaswal Posted March 28, 2016 Share Posted March 28, 2016 (edited) Hi i have a lisp it can match the text but the problem in this lisp is if i choose any think else text it show this message Incorrect Selection and end the order i need to change this plz to show this message no problem but not end the order i want to reaped the order again and thank you (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) Edited March 28, 2016 by SLW210 Changed PHP tags to Code Tags! Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted March 28, 2016 Share Posted March 28, 2016 Look at Example 1, here: http://lee-mac.com/selectif.html Quote Link to comment Share on other sites More sharing options...
mahmoudqaswal Posted March 28, 2016 Author Share Posted March 28, 2016 thanks but i was try like that by using if and any condition but i was Fail and i am not good in lisp :) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 28, 2016 Share Posted March 28, 2016 You may use my Copy/Swap Text program to match the content of selected annotation objects. Quote Link to comment Share on other sites More sharing options...
mahmoudqaswal Posted March 28, 2016 Author Share Posted March 28, 2016 thank you lee mac :D:D 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.