Common Features of Option Switches
- Last UpdatedNov 27, 2025
- 2 minute read
General Mappings
Several of the option switches map one set of values (Draft) to another (MicroStation). For example, Draft colour numbers may be mapped to MicroStation colour numbers, and Draft line styles may be mapped to MicroStation numbered or customized line-styles. These mappings are all handled in the same way.
Each mapping consists of one or more sub-mappings, separated by commas. Each sub-mapping has a left-hand (Draft) list and a right-hand (MicroStation) list separated by a colon.
Each list can include elements that are numbers (non-negative integers or reals) or strings (quoted or unquoted). Multiple elements are separated by a + character. Integers may be separated by a '‑' character to represent an inclusive range. A right-hand list of integers can include the characters 'R' (repeat) or 'D integer' (default).
The following rules apply:
-
The left-hand list must not be empty.
-
If the right-hand list has a single element, all values in the left-hand list are mapped to the same value.
-
If the right-hand list has the same number of elements as the left-hand list, each element in the left list is mapped to the corresponding element in the right list.
-
If the right-hand list contains integers with an 'R' option, each element of the right-hand list is used in turn, the elements being repeated as necessary.
-
If the right-hand list contains integers with a 'D' option, each element of the right-hand list is used in turn once only, then the default value is used for all further mappings as necessary.
Example:
'CHAINED:pdmsChained, DASHED:pdmsDashed, DDOTTED: pdmsDdotted'
'1‑11:15,12‑20:33‑41'
'1‑20:26‑30R'
(maps 1:26, 2:27, 3:28, 4:29, 5:30, 6:26, 7:27, )
'20‑29:1‑3D6'
(maps 20:1, 21:2, 23:3, 24:6, 25:6, )
Quoted Strings
Strings within mappings may be quoted, if necessary, with ' or | characters. For example, some MicroStation custom line-styles have names that include a comma or colon, such as {dash, medium}. In order to map to this MicroStation custom line-style, you must use an extra set of quotes to prevent the name being treated simply as {dash. You need outer quotes to tell Draft where the option string ends, and inner ones to tell Draft_DGN_LI where each line-style name ends, thus:
SWITCH MapLineStyle |DASHED:'{dash, medium}',LDASHED:'(dash, long}'|
A string must be quoted if any of the following apply:
-
It contains a comma, colon or plus character.
-
It starts or ends with a space or tab.
-
It starts with a minus, single quote or vertical bar.
-
It starts with a digit but is not a number (for example,, 345P).
Continuing Long Mappings
Some mappings may require string lengths longer than the permitted maximum (about 100 characters). To achieve this, switches may be continued. Continuation switches have the same name as the base switch, but extended by a single letter between A and Z. These must be used in alphabetic order. For example, the following long switch setting (all one line):
SWITCH MapLineStyle |CHAINED:pdmsChained,DDOTTED:pdmsDdotted,DASHED:'{ dash, medium }',LDASHED:'{ dash, long }'|
could be split over the following switch setting
SWITCH MapLineStyle |CHAINED:pdmsChained|
SWITCH MapLineStyleA |DDOTTED:pdmsDdotted|
SWITCH MapLineStyleB |DASHED:'{ dash, medium }'|
SWITCH MapLineStyleC |LDASHED:'{ dash, long }'|
Note: Continuation switches can be used in DLICON configuration syntax. They cannot be used in the LIEXEC command syntax.