Lesson 6 - Graphical Attributes and Layers

The visual appearance of the components is controlled by graphical attributes like e.g. color, line pattern and line width. Components can be assigned to layers. In this lesson the graphical attributes and the drawing layers are presented.

6.1 Graphical Attributes

In order to set the visual appearance of a component CADEMIA provides 6 graphical attributes. Each attribute has a DEFAULT value.

6.1.1 Define attributes

Predefined attributes can be added by executing the AddDINAttributes command. All attributes can be identified via a unique name. This name is specified when defining an attribute.

Line width: In order to define a new line width attribute run the command DefLineWidth. The line width is defined in paper units [mm].

Line pattern: In order to define a new line pattern attribute run the command DefLinePattern. The line pattern is described by a repetitive list of length specifications that represent a 'dash-gap-dash-gap' chain. The length numbers need to be defined in paper units [mm] (e.g. chain line '5.0 1.0 0.0 1.0' means 5 mm dash, then 1 mm gap, then a dot, then a 1 mm gap and started over).

Draw paint: In order to define a new draw paint attribute run the command DefDrawPaint. A draw color is described by its RGB (red green blue) value. The color dialog supports the selection of a new draw color.

Fill paint: In order to define a new fill paint attribute run the command DefFillPaint. A fill color is described by its RGB (red green blue) value. The color dialog supports the selection of a new fill color.

Font family: In order to define a new font attribute run the command DefFontFamily.

Text size: In order to define a new text size attribute run the command DefTextSize. The height of the text characters is defined in paper units [mm].

Example: Lets define a new dashed line pattern and a turquoise draw paint. Therefore we run the command DefLinePattern, enter the name "dashed" and the pattern "5.0 5.0" in the Command line. Subsequently, we run the command DefDrawPaint, enter the name "turquoise" in the Command line and choose the turquoise color from the color dialog.

color dialog

Once the line pattern and the draw paint are defined they can be selected from the respective list boxes in the Toolbar.

draw paint toolbar line pattern toolbar

6.1.2 Work with attributes

A set of all 6 attributes is assigned to each component when the component is added to the drawing. These attributes are called the default attributes. There are 6 list boxes in the Toolbar that show the current values of the default attributes. In order to change a default attribute select a different one using the list boxes.

Example: Lets set our dashed line pattern and the turquoise draw paint as default attributes.

default attributes

If we now draw a simple line it will be dashed and turquoise.

dashed turquoise line

6.2 Layers

Layers structure the drawing. Each component is assigned to a layer. A layer is described by a name, a description (semantics) and a set of the 6 attributes. Usually, the components have the same attributes as the layer they are assigned to. The NullLayer is always available and can't be deleted.

6.2.1 Defining Layers

Predefined layers can be added by executing the AddDINLayers command. In order to define a new layer run the command AddLayer. A dialog supports entering its name, its semantics and its attributes. The attributes have to be defined in advance (see Define attributes).

Example: Lets add a layer named "Dashed lines" with semantics "This layer contains dashed lines.". We assign our dashed line pattern and the turquoise draw paint to our new layer.

add layer

6.2.2 Work with layers

A layer is assigned to each component when the component is added to the drawing. This layer is called the default layer. There is a list box in the Toolbar that shows the current default layer. In order to change the default layer select a different one using the list boxes.

default layer

6.3 Exercise

Draw the shapes presented below. Add a different layer for each type of component and assign it respectively. Add and use suitable line widths, line patterns, draw paints, fill paints, font families and text sizes. Save the drawing.

exercise