This driver allows generating a MicroStation design file. The file name usually has an extension .DGN. The driver supports only MicroStation version 4.0 or later. The format's copyrights are property of Bentley Systems.
The file is created and opened by calling function cdCreateCanvas(CD_DGN, Data), in which Data contains the filename and canvas dimensions. This function opens the file and writes its header. Then, other functions in the CD library can be called as usual. The Data parameter string has the following format:
"filename [widthxheight] [resolution] [-f] [-sseedfile]" or in C "%s %gx%g %g %s"
Only the parameter filename is required. The filename must be inside double quotes (") if it has spaces. Width and height are provided in millimeters (note the lowercase "x" between them), and their default value in pixels is INT_MAX for both dimensions. Resolution is the number of pixels per millimeter; its default value is "3.78 pixels/mm" (96 DPI). Width, height and resolution are real values. Parameter -f modifies the polygon filling's behavior. Just as in MicroStation, you can specify a seed file using parameter -s. Width, height and resolution are used only by cdCanvasGetSize and in pixel-millimeter conversion.
Any amount of such canvases may exist simultaneously. It is important to note that a call to function cdKillCanvas is required to close the file properly.
Images and Colors - The DGN format does not support server images and works with an indexed-color format. Color quality is limited to 256 colors, and the format uses a uniform palette to convert RGB colors into palette indices. If you configure a palette, the color conversion process will become slower.
Filling - Up to version 5.0, MicroStation presents some limitations for polygon filling. You can disable filling by means of string "-f" in the Data parameter. Filled polygons can only have around 10,000 vertices; if the value is larger, the polygon style changes to closed lines.
Seed - In the seed file, several DGN parameters can be defined to be used in the drawing. The library offers a default seed file, called "SEED2D.DGN". The file's location depends on the environment variable CDDIR.
CD Fonts | MicroStation Font Index |
---|---|
CD_SYSTEM | 0 |
CD_COURIER | 1 |
CD_TIMES_ROMAN | 2 |
CD_HELVETICA | 3 |
CD_WHITE
.