# AutoCAD/Layers
## Layers
### Organizing Data

An important thing to realize about AutoCAD is that it is not some kind of digital drawing board. A lot of inexperienced users approach the program as if it was MS Paint for engineers, and end up creating horribly thought out and disorganized drawings that can cause no end of strife and frustration for those who may later be required to work with the files. Not only can badly created drawings cause ulcers to other AutoCAD users, they make it a lot easier for design flaws to sneak into the process. A little bit of pre-planning and some attention to good drafting practice might be the difference between a painless efficient project and a messy expensive rebuild.
The most important thing to understand is that AutoCAD does not, strictly speaking, create "drawings" in the classic sense of the word. The user should not consider themself to be making pictures or creating images. A much more useful and accurate way of thinking about an AutoCAD drawing file is as being a database full of information. The AutoCAD program allows the user to view and edit this information through a graphical interface. Thus, when drawing a line between two points, realize that you are entering two coordinates into your database. So if you want a line that links the points 200,500 and 600, 1200, then those should be the values you use. Do not, under any circumstances, just scribble down a line in a place that "looks" right. What kind of database user are you, to be inserting 199.9813 when you mean 200? If you want one line to begin where a previous one ends, then ensure they contact at EXACTLY the same point. You can use the "Object Snaps" feature to make this work properly, and there is no excuse for creating drawings that contain elements that look like they line up until you zoom in to micrometer scales and discover why those polylines weren't joining correctly or those hatches weren't applying properly etc.

### The Layers Window

The LAYERS window should be the hub around which any moderately well thought out drawing should revolve. It is through the layers window that all data is organised and controlled. A layer can be thought of as being a transparent sheet overlaying the drawing board. You can have as many as you wish. It is extremely useful to separate as much data as possible onto separate layers. It allows you to have numerous "drawings" all existing together in the one file. When a layer is "turned off" all the information that was on that layer becomes invisible.
The Layers window can be opened by either hitting the layers button on the toolbar or by typing LAYER or LA at the command line. For a new drawing, the only layer available is the layer 0. This is a special layer which is required in all drawings. It is bad drawing practice to create linework on this layer. It should be used only for creating the components of blocks and inserting xrefs. (More on these later). New layers can be created by hitting the "New Layer" button. By default, Autocad will name new layers "Layer1", "Layer2" etc. It is advisable to rename the layer to match the content that will be drawn on it, e.g. BRICKWORK, STORMWATER_PIPES, STORMWATER_MANHOLES etc.

### ByLayer

An extremely important aspect of the layers window are the columns for Color, Linetype and Lineweight. Suppose you create a new layer, and call it STORMWATER. Next you might select the color value of this layer and set it to Blue. Upon hitting OK and returning to the drawing, you might start constructing linework. You will notice that the layers toolbar has several dropdown boxes in it, again showing color, linetype and lineweight. If all is well in the world, the words ByLayer should be written in all these boxes. This means that if you have a line on the layer STORMWATER whose color is set to ByLayer, it will automatically be Blue. If you reenter the layers window and change the Color of STORMWATER to something else, everything on the layer whose color is set to ByLayer will automatically change. It is possible to set the color of an object to something other than ByLayer, by selecting the object and than opening the color dropdown box on the Layers toolbar. This is very rarely recommended though. Think about it. Suppose you are drawing lots of pipes all over your STORMWATER layer, and they are all showing up Blue. Now suppose that there is one particular pipe that you want to appear green, because it is made of steel instead of plastic or something. The cheap and lazy option is to just change that objects color to green, but this means that you have given up some control over that line, because now you can no longer edit its color through the layers window. A good rule to bear in mind is, if something is different enough to deserve its own color, then it certainly deserves its own layer. In this case you would make a separate layer (colored green) called STORMWATER_STEEL upon which you would draw this one line. You would probably then rename the original layer to STORMWATER_PLASTIC, in order to retain consistency and to make it easier for someone else to understand the drawing.

### Linetypes

Linetypes are a method of defining the pattern in which a particular line will print out, whether it be dashed or dotted or numerous other styles. The default setting is called Continuous, which just means a standard uninterrupted line. However, cases will arise, in particular when printing in black and white, in which it will be necessary to differentiate between different pieces of linework. Defining linetype works exactly the same way as for color. It can be changed individually on an object by object basis, but it is almost always preferable to leave everything set to ByLayer and adjust the settings through the layers window. By default, the only linetype available when you start AutoCAD is Continuous. To make others available, double click on Continuous in the layers window. The box that opens will have an option to "Load". The following window should provide a good list of extra linetypes which you can load as you need them. AutoCAD doesn't load them all by default to keep file size minimal. An important aspect of linetypes is scale. All lines have a property called linetype scale, which by default is set to 1. However, different linetypes may be defined in different ways. For example: a dashed line may have gaps that are 100 units apart and nearby dotted line may have been defined with gaps of only 10. It would be necessary to change the linetype scale of the dotted line to 10 to maintain a degree of consistency throughout the drawing. Just to confuse things, there is another variable called LTSCALE that effects linetype scale in the drawing at large. It is changed by typing LTSCALE at the command line. By default it is set to 1. Changes to this value are on top of changes to the object linetype scales, so if a line has its linetype scale set to 20 and LTSCALE is set to 10, the line will appear to have a scale of 200. The advantage of this is it allows you to have the same line appearing in different viewports at different scales without the linetype scale distorting.