5. Cell Attributes

The cell's attributes are contained in a record following the bounding box data (if present), but only if cell flag bit 0 is set. The record contains six fields: face color, edge color, line style, line width, display style and name. By convention, the attribute data is formatted as follows:

FaceCol<spc>EdgeCol<spc>LineStyle<spc>LineWidth<spc>DisplayStyle<spc>Name<nl>

where FaceCol is a decimal integer identifying the face color, EdgeCol a decimal integer identifying the edge color, LineStyle is a decimal integer identifying the line style, LineWidth is a decimal integer identifying the line width, DisplayStyle is a decimal integer identifying the display style, Name is a non-whitespace string identifying the name of the element, <spc> is a single space character and <nl> is the newline sequence.

If no attribute record is present, the following values are assumed:

1 1 0 1 1 none

5.1 Face & Edge Colors

Face colors are used for all 3D surfaces (solid graphics mode only) whereas edge colors are used for lines and wireframe graphics (both solid and wireframe graphics mode).

These fields are ignored if cell flag bit 4 is set; in this case, face and edge colors are inherited from the parent set. If the root set inherits from its parent, then the color is assigned elsewhere in AutoMod. For example, a vehicle may be assigned a color in a movement system; it's cell file's root set then inherits this color.

The color is encoded as a decimal integer value, whose meaning should be interpreted as follows:

Code Color
0 Black
1 Red
2 Green
3 Yellow
4 Blue
5 Magenta
6 Cyan
7 White
8 Light Gray
9 Dark Gray
10 Brown
11 Light Blue
12 Purple
13 Orange
14 Light Green
15 Light Yellow

Note that, as of V8.5, AutoMod allows the RGB (red-green-blue) settings for each color to be specified in the .asilibrc settings file. It is possible, for example, to change color 1 so that it appears blue, yellow, or some custom color. To accurately reproduce the content of a cell file's appearance, the .asilibrc file - if present - should also be processed; the format of this file is currently beyond the scope of this document. Also note that the .asilibrc file permits more than 16 colors to be defined; however, AutoMod does not appear to support colors with numbers outside the range of 0-15.

As of V10.0, AutoMod only uses the face color; edge colors are not supported by the OpenInventor scene graph and are ignored.

The default face and edge color is red (1).

5.2 Line Style

This is a decimal integer value that encodes line style, as defined in the table below. This attribute only affects lines and wireframe graphics (both solid and wireframe graphics mode) and does not affect the appearance of surfaces (solid graphics mode).

Code Line Style
0 Solid
1 Dashed
2 Dotted
3 Halftone

Note: ACE, as supplied with AutoMod V10.0, does not appear to honor line style information when reading cell files; all line styles are reset to solid as the cell file is read in. Furthermore, ACE only offers solid and dashed line styles when editing a cell.

This attribute has no effect on sets and is not inheritable.

The default line style is solid (0).

5.3 Line Width

This is a decimal integer value that specifies the number of pixels used to draw lines and wireframe graphics. Valid values are in the range 1 through 7. Note: You are strongly recommended to leave this setting at 1 pixel. The thickness of the line is expressed as the number of screen pixels that are used to draw each affected line; the thickness does not relate to the distance units in the file. Consequently, multi-pixel lines appear to get thicker as you zoom away from them creating visually distorted images. This attribute has no effect on sets and is not inheritable. The default line width is 1 pixel.

5.4 Display Style

This is a decimal integer value that encodes how each cell is to be drawn:

Code Display Style
0 Wireframe. The object is always displayed in wireframe mode even if solid graphics mode is enabled.
1 Solid. The object is displayed as a solid in solid graphics mode, a wireframe in wireframe graphics mode.
2 Almost solid (transparent 1)
3 Transparent 2
4 Transparent 3
5 Transparent 4
6 Transparent 5
7 Transparent 6
8 Transparent 7
9 Transparent 8
10 Transparent 9
11 Transparent 10
12 Transparent 11
13 Transparent 12
14 Transparent 13
15 Transparent 14
16 Almost invisible (transparent 15)

Note: ACE includes a display style option called "invisible". However, the cell file format does not support invisible cells and therefore "invisible" cells become visible the next time the image is loaded. Strange, but true.

This attribute has no effect on sets and is not inheritable.

The default display style is solid (1).

5.5 Name

This field contains the name of the cell. A valid name can contain any of the characters a-z, A-Z, 0-9, and the underscore (_) and cannot contain any whitespace characters. Names cannot be longer than 22 characters in length and must start with an alphabetic character. Note: Whilst ACE enforces these rules when running interactively, it will happily read in cell files whose element names break these restrictions. This implies that you can create element names that are longer than 22 characters, that contain special characters or that begin with a non-alphabetic first character. However, future releases may reject such names - and possibly the entire cell file - so breaking the rules is not recommended. Names do not have to be unique; however, special care should be taken when naming block definition cells or file reference cells and when referencing them as instance cells. The default name is "none".

5.6 Examples

Here is an example of an attribute record to illustrate this section:
2 2 2 1 0 DashedLine
This defines a cell that uses Green for both face (2) and edge (2) colors, is drawn with a dashed line type (2), single pixel width (1), always in wireframe mode (0) and named "DashedLine".