PDA

View Full Version : Print Layer name list



Totes100
30th Apr 2004, 07:11 pm
Hi,

How do I print a list of all the Layer names in a project?

Using Acad 2002.

TIA,

Rob

Totes100
30th Apr 2004, 08:24 pm
Found my own answer. Hope others find it useful.

Method Number 1


Enter LOGFILEON at the command prompt.
Enter -la on the command line. This invokes the LAYER command without launching the Layer dialog box.
Enter ? to select the layers to list.
Press ENTER to accept the default * wildcard character. This displays the text window with all the layer names and their properties.
Press ENTER to complete the LAYER command.
Enter LOGFILEOFF at the command prompt.
Using a word processor, such as Windows Notepad, open the file in the AutoCAD folder with the same name as the active drawing in AutoCAD. For example, test.dwg would have a logfile named test.log.

Method Number 2
Enter -la on the command line. This invokes the LAYER command without launching the Layer dialog box.
Enter ? to select the layers to list.
Press ENTER to accept the default * wildcard character. This displays the text window with all the layer names and their properties.
Press ENTER to complete the LAYER command.
Pick and drag to select the text in the AutoCAD Text window.
Right click to display the Text Window drop-down menu.
Select Copy from the drop-down menu to copy the text to the Clipboard. You can now paste the text into most Windows applications.

--------------------------------------------------------------------------------

tlyall
30th Apr 2004, 11:02 pm
or you can try this routine...

Type -layer on the command line.
Choose the ? option to get a list of layers.
Press F2 to open the Text Window.
Select the layer list.
Right-click and choose Copy.
Open a text editor such as Notepad. (Start > Run. Type Notepad and click OK.) You can use Microsoft Word or another word processor, but the columns won't line up as nicely.
Press Ctrl+V or choose Edit>Paste.
Choose File>Print.

Flores
1st May 2004, 02:50 am
Here is a routine that prints a text file of the layers. If you right click your ACAD icon on the desktop, and enter a drawing location in the shortcut tab > "start in" field, this is where this routine will make the layer file.


;Laylog.LSP: Writes a log of layers in a drawing to a file.
;


;_________________________________________________ ______________________

(DEFUN Convert_date ()
(Setq dte (rtos (getvar "cdate") 2 4))
(setq yr (substr dte 1 4))
(setq mo (substr dte 5 2))
(setq dy (substr dte 7 2))
(setq sdate (strcat "DATE: "mo "/" dy "/" yr "\t"))
)

(defun tabber (item / leng)
(setq leng (strlen item))
(cond
&#40;&#40;< leng 8&#41; "\t\t\t\t"&#41;
&#40;&#40;< leng 16&#41; "\t\t\t"&#41;
&#40;&#40;< leng 24&#41; "\t\t"&#41;
&#40;&#40;< leng 32&#41; "\t"&#41;
&#41;
&#41;


;;;;;;;;;;; below appends
&#40;DEFUN flie_append &#40;FNAME&#41;
&#40;SETQ appnder &#40;OPEN FNAME "r"&#41;&#41;
&#41;
;;;;;;;;;;;;;;;;;;;;;;;;;
&#40;defun creat &#40;fname / layer_name layer_color layer_type tab1 record layer_file&#41;
&#40;if appnder
&#40;progn
&#40;princ &#40;strcat "\nAppending current layer list to " fname&#41;&#41;
&#40;setq layer_file &#40;open fname "a"&#41;&#41;
&#41;
&#40;setq layer_file &#40;open fname "w"&#41;&#41;
&#41;
&#40;princ "\n" layer_file&#41;
&#40;princ "__________________________________________________ __\n" layer_file&#41;
&#40;convert_date&#41;
&#40;princ sdate layer_file&#41;
&#40;princ &#40;strcat "Drawing Name&#58; " fname&#41; layer_file&#41;
&#40;princ "\n\n" layer_file&#41;
;;; &#40;princ "Layer Name\t\t\tColor\tLine Type\tRemarks\n" layer_file&#41;
&#40;princ "Layer Name\t\t\tColor\tLine Type\n" layer_file&#41;
&#40;princ "__________________________________________________ \n" layer_file&#41;
&#40;setq record &#40;tblnext "layer" T&#41;&#41;
&#40;while record
&#40;setq layer_name &#40;cdr&#40;assoc 2 record&#41;&#41;
layer_color &#40;itoa &#40;cdr&#40;assoc 62 record&#41;&#41;&#41;
layer_type &#40;cdr&#40;assoc 6 record&#41;&#41;
&#41;
&#40;setq tab1 &#40;tabber layer_name&#41;&#41;
&#40;setq layer_name &#40;strcat layer_name tab1&#41;
layer_color &#40;strcat layer_color "\t"&#41;
&#41;
&#40;princ layer_name layer_file&#41;
&#40;princ layer_color layer_file&#41;
&#40;princ layer_type layer_file&#41;
&#40;princ "\n" layer_file&#41;
&#40;setq record &#40;tblnext "layer"&#41;&#41;
&#41;;end while
; &#40;princ "\n" layer_file&#41;
&#40;close layer_file&#41;
&#40;PRINC&#41;
&#41;




&#40;defun c&#58;laylog &#40;/ fname exst nme laynme laylst oldlst appnder&#41;
&#40;setq nme &#40;getvar "dwgname"&#41;&#41;
&#40;setq fname &#40;getstring &#40;strcat "\nEnter name of layer file <" nme ">&#58; " &#41;&#41;&#41;
&#40;if &#40;= fname ""&#41;
&#40;setq fname nme&#41;
&#41;
&#40;setq fname &#40;strcat fname ".txt"&#41;&#41;
&#40;flie_append fname&#41;
&#40;creat fname&#41;
&#40;princ&#41;
&#41;



Flores