DRAW Reference Manual
Colours and Styles
:
Line Styles
: User-Defined Line Styles
User-Defined Line Styles
Basic Line Style Functionality
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. 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. A unique number in the range 1-255 and is held in the LSTYNO attribute of the LNEST 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.
Advanced Line Style Functionality
It is possible to add a repeated ‘decoration’ to a line style. The ‘decoration’ can be a glyph or a text string (or indeed both together).
If a repeated glyph is required, attributes must be defined:
GLYREF
The reference of the user-defined glyph
GLYNUM
The user-defined glyph number.
These two attributes are mutually exclusive – setting one unsets the other. User-defined and system-defined glyphs are described. Refer to
Glyphs
for further information. For example:
GLYREF /flow-arrow
GLYNUM SYSpattern 15
GLYNUM can be set OFF, causing both GLYNUM and GLYREF to be unset.
DECMOD
A code number (1-7) to signify how the glyphs in respect to the line style are to be distributed. The default value is 3.
The code number is interpreted as:
1-3
Glyphs spaced along the line. DECMOD 3 is recommended to give the best overall results. Values 1 or 2 can give untidy effects at the ends of spans.
4
One glyph at the end of the line.
5
One glyph at the start of the line, with its axes reversed.
6
A glyph at each end of the line, the first having its axes reversed.
7
One glyph at the centre of the line.
DECSIZ
The size to which the glyph reference size is scaled.
DECREP
The approximate repeat distance between glyphs. The first glyph has its origin at half the repeat distance from the start of the line. With DECMOD = 2 or 3 DRAW adjusts the specified repeat distance so as to give an integer number of repeats. With DECMOD = 4, 5 or 6 the DECREP value is ignored.
DECGAP
The length of each gap left in the path. if no gaps are required, this can be 0. If it exceeds the glyph repeat distance then the path itself is completely omitted – only the glyphs are drawn. The default value is 0.
Note:
All DRAW’s pre-defined glyphs (except numbers 10, 11 and 20) have their origins at their centres and thus a repeat distance of 0 with DECMOD = 4, 5 or 6 causes them to be centred upon the end(s) of the line. The setting is generally satisfactory for balloons or dots, but with arrowheads it would cause the line to display longer than defined. For forward arrows, the glyph is set back by a distance from the line end (usually half the glyph size). To avoid over long lines for reversed arrows, the repeat distance must be equal to the DECSIZ value. The origin of each glyph is positioned at half the repeat distance from the end of the line.
If a repeated text string is required, attributes DECMOD, DECSIZ, DECREP and DECGAP must be set. For text strings DECSIZ specifies the character height.
In addition, these attributes must be set:
TXSTRI
The text string required (32 characters maximum)
TXALIG
The vertical alignment. Permitted values are BOTTOM (the default), CENTRE, TOP.
FONT
The font to be used. The font must be a TrueType font. The functionality is not available for use with AVEVA fonts.
TXSTRI can be a simple Intelligent Text string, for example #ELEVAT, which will be expanded in the context of the element being drawn. To handle the potentially variable length of the resulting string, a non-zero DECGAP will be increased by the number of characters in the string multiplied by DECSIZ so that the line is not drawn under the text.
Text strings and glyphs can both be defined but they have to have common values for DECMOD, DECSIZ, DECREP, and DECGAP.
Note that the DECSIZ, DECREP, and DECGAP parameters are affected by scale. If a linestyle with these parameters set is used:
•
to define a Symbol Template then, when that template is instanced by a Symbol, the size and frequency of the glyphs and texts are affected by the scale of the Symbol;
•
to define 3D design graphics then the size and frequency of the glyphs and texts are reduced by the View scale.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.