Defining Attributes

The DATT command defines an attribute table entry and sets that attribute as the current default. DATT has the following definition:

DATT name=colours,lst,lpc,tht,twd,tsp,tsl,font

name

Up to a 15 character attribute name.

Note: attribute names are case-sensitive.

=colours

Line and fill colour settings, and line thickness. Colours are

defined by specifying one or more colour letters, each

followed by an optional colour intensity between 0 and 255.

Lines are specified in lower case, while fill is specified with

the upper case letter. The letters used are: 

k,K

blacK

c,C

Cyan

m,M

Magenta

y,Y

Yellow

r,R

Red (magenta and yellow)

g,G

Green (cyan and yellow)

b,B

Blue (cyan and magenta)

t

line thickness in microns (default 1)

  • Lower-case letters (kcmyrgb) set the line colour.
    Upper-case letters (KCMYRGB) set the fill colour.
  • If a colour intensity is omitted, an intensity of 255 (full intensity) is used. The default line and fill colours are black and white respectively. For example, both k64bM and k64cmM are dark blue lines (cyan and magenta are equivalent to blue) and the fill colour is set to full intensity magenta.

    lst

    Line style:

    1

    solid (default).

    2

    long dashes.

    3

    dotted.

    4

    short dashes.

    5

    long/short/long dashes.

    6

    long/dot/long dash.

  • If the style is negative, then a smooth joining line is used. The default is a solid style, with a straight joining line (+1).
  • lpt

    Line pitch. The default is 0.5 cm.

    tht

    Text height in map units. The default is 0.3 cm.

    twd

    Text width in map units. The default is 0.3 cm.

    tsp

    Text spacing in map units. The default is 0.3 cm.

    tsl

    Text slant in degrees. The default is a 0 degree slant.

    font

    Text font name. The default font is DEFAULT.

    For example, the following defines an attribute entry named house, which will use a 500 micron black solid line and yellow colour fill:

    DATT house=kYt500

    To use an attribute, specify the name of the attribute in the graphics command. For example, to draw a rectangle using attribute house, the command would be:

    RECT 0,10,5,15,10,house

    When an attribute name is not specified, the current default attribute defined by the last DATT command is assumed.

    If a named attribute is used and it has not been previously defined with a DATT command, it is created with default settings. You have the option to set the line and fill colours, and the line thickness attributes by following the attribute name by an "="sign and a colour setting string. The following is equivalent to both the DATT and RECT commands of the previous example

    RECT 0,10,5,15,10,house=kYt500

    This will create an attribute named house if it does not exist, and set the attributes as defined. Note that if house did exist, its attribute settings would have been changed, and this change will affect all previous entities that used attribute house.

    Attribute Overrides

    Attribute overrides also define attributes, but become part of a graphics entity and cannot be changed by changing the attribute table. Entities drawn by MAPPLOT will allow you to specify attribute overrides by defining attributes with the graphics command. For example, the following command plots a rectangle using the house attribute table entry, but specifies a line style (3) and pitch (0.5) attribute override:

    RECT 0,10,5,15,10,house,3,0.5

    Attribute overrides remain in effect for all entities that follow until the next command that specifies an attribute name. In the following example, the first rectangle uses house with no overrides, the next two use line style overrides, and the last rectangle again uses house with no overrides:

    DATT house,kYt500

    \define attribute house

    RECT 0,10,5,15,10

    \use default attribute house

    RECT 0,20,5,25,10,,3,0.5

    \use house with style override

    RECT 0,30,5,35,10

    \override still applies

    RECT 0,40,5,45,10,house

    \house with no overrides

    Attribute overrides may also be applied to line colours, fill colours and thickness by following the attribute name with a colon and the override specification. The following command plots a house with a red outline, but still associates the rectangle with the house attribute:

    RECT 0,10,5,15,10,house:rYt500

    Colour and thickness overrides will also be passed on to following commands that do not specify an attribute name, in which case they will use the currently active default attribute and overrides.