Jump to content

I have a problem in a lisp


mahmoudqaswal

Recommended Posts

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 by SLW210
Changed PHP tags to Code Tags!
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...