anupmadhu Posted March 10, 2015 Posted March 10, 2015 (edited) I have got lot of plant names in the drawing attached. All I Need is to select those based on text string, ie. ex: if typing IXO, should select all text contain IXO. PDF of Drawing attached due to space constraint. I Use the below mentioned code by tharwat for find the total but result is in notepad can some one change it to excel. (defun c:ctxt (/ s i e f o x y l lst) ;; Tharwat 18. mar. 2014 ;; (princ "\n Select texts to export to txt file :") (if (setq s (ssget '((0 . "TEXT") (1 . "#*")))) (progn (setq o (open (setq f (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)) ".txt")) "w")) (write-line (strcat "DESCRIPTION" "\t" "QTY") o) (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i)))) x (cdr (assoc 1 e)) b "" ) (while (wcmatch (setq a (substr x 1 1)) "1,2,3,4,5,6,7,8,9,0") (setq b (strcat b a) x (substr x 2) ) ) (if (setq y (assoc (setq x (substr x 2)) l)) (setq l (subst (cons x (+ (atof b) (cdr y))) y l)) (setq l (cons (cons x (atof b)) l)) ) ) (foreach x l (write-line (strcat (car x) "\t" (rtos (cdr x) 2 1)) o)) (close o) (startapp "notepad.exe" f) ) ) (princ) ) A4_CC2-PL-01 Model (1).pdf Edited March 11, 2015 by anupmadhu Quote
SLW210 Posted March 11, 2015 Posted March 11, 2015 Please read the Code Posting Guidelines and edit your post to include the Code in Code Tags. 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.