goldy2000 Posted September 5, 2011 Share Posted September 5, 2011 I have a drawing and have to find duplicate text string, file is bigger and need an algorithm to make this automatic find, If anybody knows would be great;))), thx!!! Quote Link to comment Share on other sites More sharing options...
goldy2000 Posted September 5, 2011 Author Share Posted September 5, 2011 sorry, didnt see last post of teknomatika (which has the same theme)!!! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2011 Share Posted September 5, 2011 Quick & dirty: (defun c:TextDupes ( / a b d e i l s ) (if (setq s (ssget "_X" (list (cons 0 "TEXT") (cons 410 (if (= 1 (getvar 'CVPORT)) (getvar 'CTAB) "Model")) ) ) ) (progn (setq d (ssadd)) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i))) a (cdr (assoc 1 (entget e))) ) (cond ( (setq b (cdr (assoc a l))) (ssadd b d) (ssadd e d) ) ( (setq l (cons (cons a e) l)) ) ) ) (sssetfirst nil d) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
pBe Posted September 5, 2011 Share Posted September 5, 2011 Trying to make sense of this... ..... ( / a b d e i l s ) ..... Ahhhh .... d i s a b l e.... neat Lee Mac Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2011 Share Posted September 5, 2011 Trying to make sense of this... Ahhhh .... d i s a b l e.... neat Lee Mac that could be fun, making words out of the variables localisation Quote Link to comment Share on other sites More sharing options...
pBe Posted September 5, 2011 Share Posted September 5, 2011 that could be fun, making words out of the variables localisation You just read my mind my friend Quote Link to comment Share on other sites More sharing options...
goldy2000 Posted September 5, 2011 Author Share Posted September 5, 2011 HEy Lee Mac, this not working?? ; error: malformed list on input --> this says in command line after loading lisp Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2011 Share Posted September 5, 2011 HEy Lee Mac, this not working?? ; error: malformed list on input --> this says in command line after loading lisp Did you copy ALL the code from the code box? Quote Link to comment Share on other sites More sharing options...
ketxu Posted September 5, 2011 Share Posted September 5, 2011 @Lee : ^^ It's so funny. English & U @Goldy2000 : It worked. You should check "()" when copy ^^ And u may be use this to highlight Text same contents with the Text you choice (Lee highlight all auto) (defun c:TextDup ( / e ) (if (and (setq e (car (entsel "\nSelect find Text :"))) (wcmatch (cdadr (entget e)) "*TEXT") ) (sssetfirst nil (ssget "_X" (list (cons 0 "TEXT") (cons 410 (if (= 1 (getvar 'CVPORT)) (getvar 'CTAB) "Model")) (cons 1 (cdr (assoc 1 (entget e)))) ) ) ) ) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 5, 2011 Share Posted September 5, 2011 Trying to make sense of this... Ahhhh .... d i s a b l e.... neat Lee Mac very clever point pBe Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2011 Share Posted September 5, 2011 @Lee : ^^ It's so funny. English & U @Goldy2000 : It worked. You should check "()" when copy ^^ And u may be use this to highlight Text same contents with the Text you choice (Lee highlight all auto) (defun c:TextDup ( / e ) <... snip ... > Thanks ketxu Quick tip: (cons 1 (cdr (assoc 1 (entget e)))) == (assoc 1 (entget e)) Quote Link to comment Share on other sites More sharing options...
goldy2000 Posted September 5, 2011 Author Share Posted September 5, 2011 Did you copy ALL the code from the code box? THX man, very nice working;)), is it possible to insert dialog for area select, and to limit lisp action only to visible layers?? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2011 Share Posted September 5, 2011 THX man, very nice working;)), is it possible to insert dialog for area select, and to limit lisp action only to visible layers?? I leave that as an exercise for you Quote Link to comment Share on other sites More sharing options...
ketxu Posted September 5, 2011 Share Posted September 5, 2011 Thanks ketxu Quick tip: (cons 1 (cdr (assoc 1 (entget e)))) == (assoc 1 (entget e)) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 5, 2011 Share Posted September 5, 2011 ....... Quote Link to comment Share on other sites More sharing options...
goldy2000 Posted September 6, 2011 Author Share Posted September 6, 2011 I leave that as an exercise for you Haha, it would be interesting and unforgettable experience!!! Quote Link to comment Share on other sites More sharing options...
Saqib_theleo Posted February 26, 2019 Share Posted February 26, 2019 On 9/5/2011 at 5:48 PM, ketxu said: @Lee : ^^ It's so funny. English & U @Goldy2000 : It worked. You should check "()" when copy ^^ And u may be use this to highlight Text same contents with the Text you choice (Lee highlight all auto) (defun c:TextDup ( / e ) (if (and (setq e (car (entsel "\nSelect find Text :"))) (wcmatch (cdadr (entget e)) "*TEXT") ) (sssetfirst nil (ssget "_X" (list (cons 0 "TEXT") (cons 410 (if (= 1 (getvar 'CVPORT)) (getvar 'CTAB) "Model")) (cons 1 (cdr (assoc 1 (entget e)))) ) ) ) ) ) hello all there, i found this nice lisp by "ketxu" for selecting duplicate text, after we select one text it highlight all other same text. can someone tell me how to make this lisp to select multiple text at same time. thanks. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted February 26, 2019 Share Posted February 26, 2019 Try this: (defun c:textdup (/ f r s) (cond ((setq s (ssget '((0 . "*TEXT")))) (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (or (vl-position (setq r (cdr (assoc 1 (entget x)))) f) (setq f (cons (strcat r ",") f))) ) (sssetfirst nil (ssget "_X" (list (cons 0 "TEXT") (cons 410 (if (= 1 (getvar 'cvport)) (getvar 'ctab) "Model" ) ) (cons 1 (apply 'strcat f)) ) ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Saqib_theleo Posted February 26, 2019 Share Posted February 26, 2019 52 minutes ago, ronjonp said: Try this: (defun c:textdup (/ f r s) (cond ((setq s (ssget '((0 . "*TEXT")))) (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (or (vl-position (setq r (cdr (assoc 1 (entget x)))) f) (setq f (cons (strcat r ",") f))) ) (sssetfirst nil (ssget "_X" (list (cons 0 "TEXT") (cons 410 (if (= 1 (getvar 'cvport)) (getvar 'ctab) "Model" ) ) (cons 1 (apply 'strcat f)) ) ) ) ) ) (princ) ) Hello ronjonp, thanks for reply, yes this is what i needed.thanks for your help. thank you..GBY. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted February 26, 2019 Share Posted February 26, 2019 Glad to help 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.