Basic Line Style Functionality
- Last UpdatedApr 27, 2023
- 3 minute read
User-defined Line Styles are defined in the database by LINESTyle elements which are members of a Line Style Table (LSTYTB) element.
To be valid the definition of a LINEST must include (at the minimum) definitions for dash-pattern geometry, pattern repeat distance and line width.
The dash-pattern geometry can be defined in two ways, either by specifying an existing system-defined pattern by name or by specifying a sequence of integer numbers that define the relative lengths of the sequence of dashes and gaps that make up the pattern. These two ways are defined by the attributes PATNAM and PATDEF; these are mutually exclusive – setting one unsets the other.
|
PATNAMe |
The name of an existing system-defined line pattern (for example, LDASHED) to be used as the basis of the user-defined line style. Refer to System-Defined Line Styles for further information. PATNAM can be set to OFF which usually leaves the main line undrawn, this is useful to obtain a 'line' consisting of just glyphs or text By default PATNAM is set to SOLID. |
|
PATDEFinition |
A series of integers (max 20) that define the relative lengths of the dashes and gaps. A dash is represented by a positive value and a gap by a negative value. Dashes and gaps must alternate and we recommend that the pattern sequence starts with a dash. |
|
LWIDTH |
The width of the line (in mm or inches). Value 0 is allowed and means the minimum-allowed line width. The maximum allowed width is 10mm (0.393inch). |
|
PATREPeat |
The approximate distance at which the pattern is to be repeated and to which the sum of all the lengths of the dashes and gaps are scaled. |
Thus for example:
NEW LINEST /LS1
PATNAM DCHAINED
PATREP 45mm
LWIDTH 0.2mm
produces a linestyle similar to the user-defined DCHAINEDMEDIUM style but with a greater repeat distance.
And:
NEW LINEST /LS2
PATDEF 10 -3 5 -3 5 -3 10
PATREP 30mm
LWIDTH 0
produces a linestyle of two short dashes inserted between pairs of long dashes. The repeat distance is 30mm and a minimum line width is specified.
Element LINEST also has attributes:
|
LSTYNO |
A system-defined attribute that has a unique value within the MDB. It is this number that is used when the Linestyle is used. |
|
FUNC |
Text attribute for descriptive purposes. |
|
ALTDEF |
If set it must refer to another LINEST. If set the referenced LINEST is used on hard copy output. Thus if at /My-Linestyle: ALTDEF is set to /My-Plot-Linestyle it is /My-Plot-Linestyle that is used on hardcopy output in place of /My-Linestyle. |
When the LINEST element is created a system-defined line style number is allocated automatically. This is a unique number in the range 1-1000 (the maximum number of user-defined line styles) and is held in the LSTYNO attribute of the LINEST element. The number can be used for a linestyle attribute (for example, NLSTYLE) when it is required to use that LINEST.
Alternatively, it is usually more convenient to specify a name for the LINEST, and then this is used to set the linestyle attribute (although it is the LSTYNO value that is assigned to the linestyle attribute). Thus for example:
NLSTYLE 3
DLSTYLE /DimLineStyle-1
Having created a Linestyle it must be defined within the graphics system by an UPDATE PENSTYLES command if it is to be used during that session of Draw. In subsequent sessions it is automatically defined during module entry.