Hi every one. I have a question: When I use the attribute extract wizard (typing "eattext") on the option "select drawings"; it leaves out 3 of the 9 files I need to process. All these files have the block I need to extract info from. It kind of suggests that the eattext command is limited to a certain number of files to process, the problem is that the files it leaves out are not the last ones but in a random fashion along the list as the Autocad browser shows them. Once the process is done and eattext is applied to the files it left out the first time it processes them with no problems. Any Ideas? I am using Autocad 2005. Looking for a solution:
I found the following lisp routine to do this and its instructions. The problem is that it extracts info from all the blocks with attributes on the drawings processed, it writes a column for the attribute value and another one with the attribute tag to the right of the first one -this may be a matter of interchanging two rows of code-, and it would be nice if it put the tags as titles of columns and the data under each column.
The instructions are:
"To process a few drawings drag the lisp file icon in the drawing area. The program will auto start.
A possible usage for batch processing: open a new drawing, go to TOOLS > AutoLisp > LOAD� and in the "Load/Unload Application" window locate the lisp file and drag it in the Startup Suit. Now this program will be loaded in every drawing. Close the window and go to FILE > OPEN. Select all the files you wish to process (hold shift/Ctrl to select multiple files) and press OPEN. Relax and watch the screen. After the last file opened search the file C:attributes.CSV and open it with Excel. Probable a double-click on the file will make it open in Excel, but that also depends on your settings.
If a dwg contains no blocks with attributes you will see an error message in the AutoCAD command line. Please ignore it.
And don't forget to remove the program from the Startup Suit!
P.S. Without an adequate filter the program will extract all your attributes -including the data in the title data block, date stamp and so on.
The code is:
Code:
; Global ATTribute EXtractor
; by Miklos Fuccaro mfuccaro@hotmail.com
;-------------------------November 2004 -------
(defun gattex ()
(setq ss (ssget "X" '((0 . "INSERT") (66 . 1))))
(if (not ss)
(quit)
)
(setq file (open "c:attributes.CSV" "a")
i -1
)
(write-line
(strcat (getvar "DWGPREFIX")
(getvar "DWGNAME")
" -found "
(itoa (sslength ss))
" block(s) with attributes"
)
file
)
(repeat (sslength ss)
(setq l (entget (setq e (ssname ss (setq i (1+ i))))))
(write-line
(strcat "block name:" "," (cdr (assoc 2 l)))
file
)
(while (/= (cdr (assoc 0 l)) "SEQEND")
(if (= (cdr (assoc 0 l)) "ATTRIB")
(write-line
(strcat ",," (cdr (assoc 1 l)) "," (cdr (assoc 2 l)))
file
)
)
(setq l (entget (setq e (entnext e))))
)
)
(close file)
(princ)
)
(gattex)
It seems that the editor takes out the tab and spaces at the begining of each row. I hope it does not make a difference.
I know I may sound too picky but the truth is I don't know any programing or Lisp. Can someone please help?
Thank you for your time.
[ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]