PDA

View Full Version : Print list of blocks



DODGE
3rd Apr 2007, 05:47 am
Just a quick one
Does anybody know how to do a print off of
all your block names.
I have made heaps of blocks and would just like to have a printed
copy of what I've got and what I have named them for future ref.

Thanks Dodge.8)

Cad64
3rd Apr 2007, 06:05 am
Check out the EATTEXT command. You can save out a list of all the blocks in your current drawing to an Excel file.

fuccaro
3rd Apr 2007, 06:18 am
Or use this to save in a text file:

(defun c:blist( / b1 file i)
(setq b1 (tblnext "BLOCK" T) i 0)
(if b1 (setq file (open (strcat (getvar "dwgprefix")
(substr (getvar "dwgname")
1 (- (strlen (getvar "dwgname")) 3)
)
"TXT"
) "W")
)
)
(while b1
(write-line (cdr (assoc 2 b1)) file)
(setq b1 (tblnext "BLOCK") i (1+ i))
)
(close file)
(princ (strcat (itoa i) " block(s) listed"))
(princ)
)
Run the lisp and search for a text file near the DWG.
Also with some extra work it is possible to run the routine in batch mode -meaning all the drawing from within a directory can be processed at a time.

Alan Cullen
3rd Apr 2007, 06:32 am
You can also do this in windows.......

start -> run -> command __________________ type command and a windows shell will come up.

then in the shell type...... chdir c:\ __________ this changes the directory

then type ..... dir c:\acaddwg\*.dwg /o > c:\acaddwg\dir.txt .....where acaddwg is the folder you keep all your blocks in.

Then use a text editor (something like UltraEdit) to manipulate your list. The file produced is called dir.txt and will be placed in your blocks folder.