Tharwat Posted November 21, 2014 Posted November 21, 2014 Another advanced one to obtain your new needs of the program (defun c:test (/ ss i st l lst s) (if (setq ss (ssget "_X" '((0 . "*TEXT") (1 . "*IBM*,*COUPLER*,*Form savers*,*coupler*,*THREAD*,*THREADING*" ) ) ) ) (progn (repeat (setq i (sslength ss)) (setq st (cdr (assoc 1 (entget (ssname ss (setq i (1- i))))))) (if (not (member st lst)) (setq lst (cons st lst)) ) ) (if lst (progn (mapcar '(lambda (u) (if (vl-some '(lambda (x) (wcmatch x u)) lst) (setq l (cons (vl-string-trim "*" u) l)) ) ) '("*IBM*" "*COUPLER*" "*Form savers*" "*coupler*" "*THREAD*" "*THREADING*" ) ) (alert (strcat "You have used < " (substr (setq s (apply 'strcat (mapcar '(lambda (x) (strcat x ",")) l) ) ) 1 (1- (strlen s)) ) " > in this drawing" ) ) ) ) ) (alert "Couldn't find any of these strings < IBM,COUPLER,Form savers,coupler,THREAD,THREADING > in drawing " ) ) (princ) ) Quote
dreams Posted November 21, 2014 Author Posted November 21, 2014 Hi Tharwat, It's working very fine what i expected... Thanks a lot. This lisp will save lot of our future problems. Thanks again... Quote
Tharwat Posted November 21, 2014 Posted November 21, 2014 Hi Tharwat, It's working very fine what i expected... Thanks a lot. This lisp will save lot of our future problems. Thanks again... You are very welcome 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.