Getting a Text File List of Layers or Blocks
With complex drawings, it can be helpful to get a text file that lists the layers or blocks in your drawing.
You can do this by using the log-file feature in AutoCAD. At the command prompt, enter Logfilemode.,
and then enter 1.. Type –La.?.. (don’t forget the minus sign at the beginning of the
La command). If your list of layers is extensive, you may be asked to press . to continue. Do so.
Your list of layers appears in the Command window. Press the F2 key to view an expanded version
of the Command window. For a list of blocks, enter –Insert. ?... When you’ve obtained your list,
close the log-file feature by typing Logfilemode. 0..
Once the log-file feature is closed, you can use Windows Notepad to open the AutoCAD log file
located in the C:\Documents and Settings\YourName\Local Settings\Application Data\
Autodesk\AutoCAD 2008\R17.1\enu\ folder. The name of the log file will start with the name of
the current drawing, followed by a series of numbers and the .log filename extension, as in 04cbath-
metric_1_1_6500.log.
If you have difficulty finding the log file, enter (getvar “logfilepath”) at the AutoCAD Command
prompt to get a listing of the log-file location. The log file may also be in a hidden folder, so you may
have to turn off the hidden folder setting in Windows Explorer. See Appendix A for instructions on
how to do this.
With the log-file feature, you can record virtually anything that appears at the Command
prompt. You can even record an entire AutoCAD session. The log file can also be helpful in constructing
script files to automate tasks. (See Chapter 26 for more information on scripts.) If you
want a hard copy of the log file, print it from an application such as Windows Notepad or your
favorite word processor.
Assigning Colors, Linetypes, and Linetype Scales to Individual Objects
If you prefer, you can set up AutoCAD to assign specific colors and linetypes to objects, instead of having
objects take on the color and linetype settings of the layer on which they reside. Normally, objects are
given a default color and linetype called ByLayer, which means each object takes on the color or linetype
of its assigned layer. (You’ve probably noticed the word ByLayer in the Object Properties toolbar and in
various dialog boxes.)
Use the Properties toolbar to change the color or linetype of existing objects. This toolbar lets you set the
properties of individual objects. For new objects, use the Color control drop-down list on the Properties
toolbar to set the current default color to red (for example) instead of ByLayer. Then, everything you
draw will be red, regardless of the current layer color. The Color control drop-down list also offers a
Select Color option that opens the Select Color dialog box you saw earlier in this chapter.
For linetypes, you can use the Linetype Control drop-down list in the Properties toolbar to select a
default linetype for all new objects. The list shows only linetypes that have already been loaded into the
drawing, so you must first load a linetype before you can select it.
Another possible color and linetype assignment is ByBlock, which you also set with the Properties toolbar.
ByBlock makes everything you draw white, until you turn your drawing into a block and then insert
the block on a layer with an assigned color. The objects then take on the color of that layer. This behavior
is similar to that of objects drawn on layer 0. The ByBlock linetype works similarly to the ByBlock color.
Finally, if you want to set the linetype scale for each individual object, instead of relying on the global
linetype scale (the Ltscale system variable), you can use the Properties palette to modify the linetype
scale of individual objects. In place of using the Properties button, you can set the Celtscale system variable
to the linetype scale you want for new objects.
As mentioned earlier, stay away from assigning colors and linetypes to individual objects until you’re
comfortable with AutoCAD; even then, use color and linetype assignments carefully. Other users who
work on your drawing may have difficulty understanding your drawing’s organization if you assign
color and linetype properties indiscriminately.
The Bottom Line
Organizing Information with Layers Layers are perhaps the most powerful feature in
AutoCAD. They help to keep drawings well organized and they give you control over the
visibility of objects. They also let you control the appearance of your drawing by setting
colors, lineweights, and linetypes.
Master It Describe the process of creating a layer.
Solution First, click the Layer Properties Manager tool in the Layers control panel. Second,
click the New Layer button at the top of the dialog box. Finally, type the name for your new layer.
Controlling Layer Visibility When a drawing becomes dense with information, it can be difficult
to edit. If you’ve organized your drawing using layers, you can reduce the complexity of
a drawing by turning off layers that aren’t important to your current session.
Master It Describe two methods for hiding a layer.
Solution Open the Layer Properties Manager, select a layer, and click the Freeze icon for
the layer. Then, open the Layer drop-down list in the Layers control panel, and click the
Freeze icon for the layer you want to hide.
Keeping Track of Blocks and Layers At times, you may want a record of the layers or blocks
in your drawing. You can create a list of layers using the log file feature in AutoCAD.
Master It Where do you go to turn on the log file feature?
Solution The Options dialog box.