poka.sh

Docs

DGN

Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.

Bentley MicroStation DGN Preview.

At a glance

Original creator Intergraph, with the V8 structure by Bentley Systems
Purpose The drawing format of MicroStation and related CAD software, used for technical drawings by architects and engineers.
Extensions .dgn
Poka parser poka-dgn
Viewer poka-metadata-card-viewer
Depth tier Metadata card (see Depth tiers)
Breadth tier B5 Identification (see Breadth tiers)

How much Poka reads

B5 Identification. The format is recognised and a few properties are shown (name, size, version string). Nothing of the content is decoded.

Confidence: medium (the reviewer read the code). Basis: Reviewed 2026-10-19: the crate rewritten and run over GDAL's MIT smalltest.dgn (a local fixture; there is no DGN file in poka-samples). The signatures are the ones real files start with and both GDAL's DGNTestOpen and the file(1) magic accept: 08 09 FE 02 (2D) and C8 09 FE 02 (3D); the old 0x0801/0x0802 words matched neither. The V7 card reads the file header (dimension from the signature and the TCB flag, units as Radix-50 master/subunit names, UOR per subunit and subunits per master, both in VAX byte order) and walks the element stream to its FF FF end marker, counting elements by type with GDAL's DGNT_* names. The fifteen elements and the MU/SU, 1000 and 10 unit values are the ones GDAL reads from the same fixture. A V8 file is recognised as a compound file and its stream directory is read; the elements are not.

What Poka does not read

  • Every element's geometry, the contents of levels, colours and reference files are not decoded
  • Nothing is drawn
  • The VAX D floating origin and the eight view definitions in the file header are not read
  • DGN V8's element data inside the Dgn~ stream is Bentley's own encoding; only the container and its stream names are read
  • No real V8 file was available to test against, so the V8 path is exercised only on the signature and the compound-file directory

Background

The Library of Congress separates version 7 and earlier, which keep the original Intergraph binary structure, from version 8 and later, which use Bentley's different structure without many of the old size and count limits. Bentley owns the format. Poka's code shows a metadata card for a version 7 file and says what a version 8 compound file holds, and does not draw the elements. It is verified against GDAL's MIT-licensed smalltest.dgn (a local fixture, parsers/poka-dgn/samples/), because poka-samples holds no DGN file.

Versions

Version Identifier Poka Note
DGN V7 08 09 FE 02 (2D) / C8 09 FE 02 (3D) Partly read Header-level metadata only (parsers/poka-dgn/src/main.rs): dimension, units, resolution and the element count by type. Verified against GDAL's smalltest.dgn.
DGN V8 D0 CF 11 E0 (compound file) Not read Recognised as a compound file and its stream directory read (the Dgn~ stream is named); the elements are Bentley's own encoding and are not decoded.

Libraries

Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.

  • ezdgn (candidate; MIT; Rust core with Python bindings; https://github.com/monozukuri-ai/ezdgn) — Read-only V8 and read/write V7 DGN; v0.2.7 on PyPI uploaded Oct 2026. Licence taken from PyPI classifiers/README (licence field empty).
  • GDAL/OGR DGN driver (candidate; MIT; unknown; https://gdal.org/en/stable/drivers/vector/dgn.html) — language: C/C++ (bindings for Python, Java, etc.); Built-in driver reads only pre-V8 DGN; the V8 driver needs the non-open-source ODA Teigha library. MIT taken from the GDAL repository About text (github.com/OSGeo/gdal).
  • DGNLib (candidate; MIT; C/C++; https://github.com/omni360/dgnlib-1.1) — Frank Warmerdam's library (GitHub mirror); V8 files not recognised, so V7 only.
  • Open Design Alliance Drawings SDK (candidate; Commercial; C++; https://docs.intellicad.org/files/oda/2021_11/oda_drawings_docs/TG_TG.html) — Developer guide describes reading, writing and rendering .dgn (V7 conversion optional module). Current pricing and terms not checked; vendor brochure describes a fixed-fee licence. (documentation page needs a sign-in)

Software that uses it

  • Bentley MicroStation
  • Bricsys BricsCAD

Sources