Line/Color Related Options
- Last UpdatedNov 27, 2025
- 3 minute read
MapLineWeights
MicroStation has 32 line-weights (numbered 0-31); Draft has 11 line thicknesses (numbered 1-11). The links between them are controlled by the MapLineWeights option, for example:
SWITCH MapLineWeights '1:0,2:1,3:5,4-11:31'
SWITCH MapLineWeights '1-11:0-10'
The second example is the default.
MapLineStyle
MicroStation has seven numbered line-styles, and can also have named custom line-styles.MicroStation documentation recommends using named styles, but some drawing standards specify numbered ones. Draft also uses a mixture of named and numbered linepatterns. The MapLineStyle option maps the Draft line-pattern to a MicroStation line-style, ignoring line picture and glyphs. (See MapLineStyleByPen for how to map linestyles involving line pictures or glyphs.)
A resource file pdms_lsty.rsc supplied with Draft contains custom line-styles equivalent to the default named Draft line-patterns.
-
Any ScaleFactor (see ScaleFactor) is applied to custom line-styles used in the DGN file.
-
Any unmapped line-styles map to Solid lines.
The following example maps Draft’s named line-styles to their nearest equivalents in MicroStation’s numbered styles. This is the default:
SWITCH MapLineStyle 'SOLID:0,DASHED:2,DOTTED:1,CHAINED:4,
LDASHED:3,DDOTTED:6'
The next example maps Draft named line-styles to some custom line-styles provided as a MicroStation resource file:
SWITCH MapLineStyle'CHAINED:pdmsChained,DASHED:pdmsDashed
,DDOTTED:pdmsDdotted,DOTTED:pdmsDotted,LDASHED:pdmsDashed
,SOLID:0,TCHAINED:pdmsTChained'
Custom line-style names can include spaces and punctuation; for example, the default MicroStation/J installation includes styles { -E- } and { Cable / Tele }. See Quoted Strings for details of when you must quote the style-names. As this mapping can get long, (the preceding example is a single line mapping), you may need to use the continuation facilities described in Continuing Long Mappings.
MapLineStyleByPen
More complex line-styles can be set up by the combination of line-pattern, line picture, line thickness and glyph. To map these combinations onto MicroStation line-styles, you must map them by Pen Number. (Note that this is the pen number as stored in the database, which is not the same as the pen number in the Draft Administrator User Defined Pen Settings form.)
For example, you might have Draft pen numbers 217 and 222 set up as:
setpen 217 colour 4 solid lthick 2 lpic 4 glyph 1
lpicture 22 mode 3 size 2 repeat 12 gap 4
setpen 222 colour 6 solid lthick 1 lpic 22 glyph 12
and wish to map these to the MicroStation custom line-styles Pneumatic and ‘Data link’
respectively. For this you could use the switch setting:
SWITCH MapLineStyleByPen '217:Pneumatic,222:|Data link|'
Custom line-style names can include spaces and punctuation; for example, the default MicroStation/J installation includes styles { -E- } and { Cable / Tele }. See Quoted Strings for details of when you must quote the style-names. As this mapping can get long, you may need to use the continuation facilities described in Continuing Long Mappings.
MapColour
Both Draft and MicroStation use colour numbers, and the mapping between them is controlled by the MapColour switch. The interpretation of these colours by MicroStation depends on the colour-table loaded (this can be included in the seed file). For example:
SWITCH MapColour '1:11,2:1,3:6,4:2,5:3,6:4,7:5,8:37,9:33,
10:0,15:254'
SWITCH MapColour '1:96,2:51,3:22,4:52,5:50,6:15,7:49,
8:64,9:51,10:0,11:96,12:13,13:63,14:197,15:25416:37'
The second example gives a fairly close fit in MicroStation to the Draft colours
used if no seed-file is specified. This is the default mapping. Any unmapped colours are mapped to MicroStation colour 0.
The sample seed-file pdmsSeed2d.dgn contains this mapping. The following mapping should be used with this seed-file:
SWITCH MapColour ‘1-256:0-255’
The default mapping is 1-256:0-255. Any unmapped colours are mapped to MicroStation colour 0. This mapping should be used when the supplied seedfile is used.
MarkerSize
This option sets the size of an Draft marker in millimetres (at scale 1). The size of a marker in the DGN file will be the product of this size, the scale of the relevant Draft pen, and the overall ScaleFactor switch setting (see ScaleFactor). The default is 1.0.