Jump to content

Select and Move Mtext & Ttext (Find total & get result in excel)


Recommended Posts

Posted (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

Planting.jpg

Edited by anupmadhu

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...