DRAW Reference Manual
Colours and Styles
:
Fill Styles
: User-Defined Fill Styles
User-Defined Fill Styles
Basic Fill Style Functionality
User-defined Fill Styles are defined in the database by
FILLSTyle
elements which are members of a Fill Style Table (
FSTYTB
).
A FILLST is defined either as 'Solid Fill' or by 1 or more Hatch Patterns (
HPATTE
). A basic Hatch Pattern is defined in terms of four parameters:
Line Style (HLSTYLE):
the style with which the hatch lines are drawn. The style can either be a system-defined line style, thus: Chained or DashedThick, or a user-defined line style, specified either by its LSTYNO value or by its database name. By default HLSTYLE is set to SOLID.
Angle (HANGLE):
the slope of the hatch lines in degrees measured in a counter clockwise direction from the horizontal. The value specified must lie in the range -360 to 360. If not specified a value of 45 is assumed.
Separation (HSEPAR):
the spacing between the hatch lines (measured perpendicularly). If 0 then a solid fill is achieved. The specified value is always used in plot files; on terminals the spacing is device-dependent but it is related to the specified value. If no value is given, 3mm is assumed.
Offset (HOFFSET):
the offset of the hatch-pattern from a datum point on the Sheet. It is only of use when two or more hatch-patterns are combined. If they have the same angle and separation but different offsets double-line hatching can be achieved. If no value is given 0 is assumed. If the value is positive the positioning of the pattern is relative to the bottom left corner of the Sheet, if negative the positioning of the pattern is relative to some feature of the area being filled. For patterns that require the precise matching of diagonal dashes (to form triangles for instance) it is probably necessary to define relative patterns (with negative offsets) but in general positive offsets must be used. If no value is given, 0mm is assumed.
Thus the commands:
NEW FILLST /My-Fillstyle
NEW HPATTE
HANGLE 35
HSEPAR 3.5mm
creates a Fillstyle composed of parallel lines 3.5mm apart at an angle of 35deg.
Adding a second HPATTE thus:
NEW HPATTE
HANGLE 35
HSEPAR 3.5mm
HOFFSE 1mm
converts /My-Fillstyle into a double-line Fill Style with double lines (1mm between them) repeated every 3.5mm
Element FILLST also has attributes:
FSTYNO:
A system defined attribute that has a unique value within the MDB. It is this number that is used when the Fillstyle is used.
SOLFILled:
If set TRUE causes the Fillstyle to provide solidfill. The default setting is FALSE.
FUNCtion:
Text attribute for descriptive purposes.
ALTDEF
If set it must refer to another FILLST. If set, the referenced FILLST is used on hard copy output. Thus if at /My-Fillstyle:
ALTDEF is set to /My-Plot-Fillstyle it is /My-Plot-Fillstyle that is used on hardcopy output in place of /My-Fillstyle. The default setting is unset.
When the FILLST element is created a system-defined fill style number is allocated automatically. The unique number is in the range 1-255 and is held in the FSTYNO attribute of the FILLST element. The number can be used for the FSTYLE attribute when it is required to use that FILLST.
Alternatively, it is usually more convenient to specify a name for the FILLST, and this is then used to set the FSTYLE attribute (although it is the FSTNO value that is assigned to the FSTYLE attribute).
Having created a Fillstyle 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 Fill Style Functionality
In order to create more complex patterns, for example Triangles or Brickwork, it is necessary to use two additional attributes of HPATTE:
Line Pattern
Advance (PATADV)
:
the amount by which the pattern on each individual line is advanced. The pattern is moved by a value which accumulates from line-to-line. The lines either side of the first are offset by ± the advance value. The lines either side of these are offset by ± twice the value.
Line Pattern
Offset (PATOFF)
:
the amount by which the pattern of the first hatch-line is offset from its nominal start point.
Thus for example, in order to create a Fill Style to represent brickwork (with 10mm x 4mm bricks) we first need to create a suitable linestyle for the vertical lines and then a Fillstyle with 2 Hatch Patterns:
NEW LSTYTB
NEW LINESTYLE /BrickWork-VerticalLS
PATDEF 50 -50
Creates a pattern with equal sized dashes and gaps
PATREP 8mm
Sets the repeat distance to the height of 2 bricks
NEW FSTYTB
NEW FILLSTYLE /BrickWorkFS
NEW HPATTERN /BrickWork-HorizontalHP
HLSTYLE Solid
HANGLE 0
HSEPAR 4mm
4mm between horizontal lines
HOFFSE 2mm
Offsets the pattern (vertically) from its datum
NEW HPATTERN /BrickWork-VerticalHP
HLSTYLE /Brickwork-VerticalLS
HANGLE 90
HSEPAR 5mm
10mm long bricks require 5mm between vertical lines
HOFFSE 3mm
Offsets the pattern (horizontally) from its datum
PATOFF 2mm
Offsets the pattern (vertically) from its datum
PATADV 4mm
Causes the 'dash' in the vertical lines to advance by the brick height and so create the 'staggered' effect
Offsetting the pattern is not strictly necessary and so attributes HOFFSE and PATOFF of both HPATTEs can be left at 0mm; it is merely done to reduce the chance of the horizontal and vertical lines coinciding with the edge of the hatched area.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.