A linetype is an object that defines the appearance of lines and contours for entities that are associated
with it. A linetype defines the pattern that is repeated in the direction of the plotted line. The pattern
consists of straight line segments and text or a shape that define the characteristics of the linetype. Segments
can have different lengths and can be visible or invisible. Inclusions can be a text string or shape. The typeface
of the inclusion can be defined by the rotation angle, scale factor, offset, and associated text style. For example:
A linetype is applied both to geometric objects (any entity), and non-geometric objects (OdDbMLeaderStyle,
OdDbLayer, OdDbDimStyleTableRecord). Geometric objects use linetypes to define how to render their own
lines and contours. When a new entity is created, it is associated with a linetype. Non-geometric objects use linetypes
to define the style of lines for those objects with which they are associated.
To refer to a linetype, the objects use an Object ID which is stored in their own data. Several entities can refer
to the same linetype. The database associates an ID with each linetype and requires the assignment of a unique name for
each linetype in order to identify it.
Linetypes can be defined programmatically through objects of the program or through an .lin file using an external
text editor. Each linetype is defined by two lines in the .lin file.
The first line contains the name of the linetype and its optional description.
The second line contains the actual linetype pattern. The second line must begin with the letter A (for alignment).
After alignment follows a pattern that defines pen-up lengths (spaces), pen-down lengths (dashes), and dots. A positive
decimal number specifies the length of a pen-down (dash) segment. A negative decimal number specifies the length of a
pen-up (space) segment. Zero specifies a dot. For example, the "Dash Dot" linetype is defined by a repeating
pattern starting with a dash 0.5 drawing units long, a space 0.25 drawing units long, a dot, and another space 0.25
drawing units long.
The following is an example of the contents of an .lin file: