Color, Linetype, Entity Linetype Scale, Lineweight and Plot Style
The appearance and plotting of AutoCAD objects is controlled by four (CTB plot styles) or five (STB plot styles) properties of each object, which can be found and set on the Design tab of the Properties palette, in the General category.
Color: Determines the color used to draw the object on the screen. For color-dependent plot styles, also determines the plot style used to plot the object. When the object’s plot style calls for the plotted color to "use object color", also determines the plotted color (within the limitations of the plotting device used).
Linetype: Determines the pattern of dots, dashes and gaps used to drawn the object. Linetypes are defined in external text files with a LIN extension, following a prescribed format, and can be loaded into a drawing using the LINETYPE command.
Entity Linetype Scale: Three factors determine the final multiplier applied to the dashes and gaps included in the linetype definition. The first is the value of the LTSCALE system variable, which is a global scale factor applied to all objects. The second applies only to objects drawn in model space but viewed through a viewport on a layout, and is controlled by the PSLTSCALE system variable. If PSLTSCALE is set to 0, no additional scale factor is applied; if PSLTSCALE is set to 1, then a scale factor compensating for the zoom factor of the viewport, relative to paper space (often referred to as the scale of the viewport) is applied. Finally, the Entity Linetype Scale is applied. The default value for newly created entities is stored in the CELTSCALE system variable; this should, under almost all circumstances, be set to 1, to maintain a uniform look to a given linetype across all entities. On occasion, an individual entity may have its Entity Linetype Scale set to something other than 1; for example, a short line segment may need an Entitiy Linetype Scale set to slightly less than 1 to get at least one instance of the linetype pattern to show. New in 2008, an additional system variable, MSLTSCALE, allows you to work as you did before, when set to 0, or, when set to 1, allows you to set PSLTSCALE to 1, LTSCALE to the value you would use when plotting full size (1:1) and then leave these values alone, as the drawing scale will be factored into the display of linetypes in the Model tab. Read more about this new feature in this blog article.
Lineweight: Determines the relative width with which an object is drawn on the screen when the LWDISPLAY system variable is set to 1. The value of LWDISPLAY can be set using the "LWT" toggle on the Application Status Bar. When the object’s plot style calls for the plotted lineweight to "use object lineweight", then this setting also determines the plotted lineweight.
Plot Style: The plot style assigned to an object determines how the object will plot. For named plot styles, this is an explicit assignment in the drawing; for color-dependent plot styles, the plot style is assigned based on the object’s color.
ByLayer and ByBlock
In addition to assigning explicit values for color, linetype, lineweight and plot style, there are two "special" options, BYLAYER and BYBLOCK.
Assigning BYLAYER to a property causes the object to inherit the value for that property from the layer on which the object resides. Nested items within a block definition that are defined on the special layer "0" inherit the layer of the parent object, and, when "BYLAYER" is specified for a property, the value assigned to that property on the layer of the parent object.
Assigning BYBLOCK to a property of a nested object – such as an object within a block definition or a component of a dimension, causes that object to inherit the property of the parent object. If BYBLOCK is assigned to a main object, the default value for that property (color 7, continuous linetype, the drawing default lineweight and the Normal plot style) will be used for the object until it is made part of a block.
To illustrate the effects of ByLayer and ByBlock, I created a block definition that included the following items, with the noted layer and color properties. The effects of ByLayer and ByBlock, when applied to linetype, lineweight or plot style would be similar. The drawing file in which the block was created has four layers of interest: 0, color 7; Red, color red; Blue, color blue; and Magenta, color magenta.
Lines: In both cases, the two lines are "orange" (color 30), as they were defined with that color explicitly assigned, so neither the color of the layer on which they reside ("red", for the Red layer) nor the color of the parent block ("magenta" on the left or "green" on the right) have any effect on them.
Triangle: The triangle is "red" in both cases, because the triangle was defined on layer Red, and its color was set to "ByLayer", so it inherits the color of the layer on which it was placed.
Square: The square is "magenta" in both cases, because the square was defined on the special layer 0 and color was set to "ByLayer", so it inherits the layer of the parent object (Magenta) and therefore the color of that layer.
Pentagon: Like the square, the pentagon has an explicit layer assignment, in this case Blue, and therefore the "ByLayer" assignment results in the color being "blue" in both cases.
Hexagon: The hexagon is also placed on the Blue layer, but the color is assigned as "ByBlock", so it inherits the color of the parent object. On the left, that color is "ByLayer", so the color of the layer of the parent object is used – "magenta". On the right, the parent block’s explicitly assigned color "green" is used.
Circle: The circle is on the special layer 0, so, like the square, it inherits the layer of the parent object (Magenta). Unlike the square, it is assigned a color of "ByBlock", so while it appears "magenta" on the left, where the block is set to "ByLayer", on the right is appears "green", as the block is set to "green".
Note the difference in the behavior of the square and circle. Both are on the special layer 0, so both inherit the layer of the parent block object and both would not be visible if the Magenta layer were set to "Off". The square will always display with the block layer’s color, while the circle will always display with the block’s color. Sometimes those two may be the same, as on the left; other times they may be different, as on the right.
Next Article in the Series: ACD-A Display System - Part 2, Big Picture Overview