DGN Reader
DGN | |
File Extension | DGN |
Supported Versions | 7, 8 |
Platforms | ![]() ![]() ![]() ![]() ![]() |
Tessellation | ![]() |
B-rep | ![]() |
PMI | ![]() |
The DGN (Design) format is a prominent file format used primarily for computer-aided design (CAD) applications. Developed and maintained by Bentley Systems, DGN files are extensively employed in various industries, including architecture, engineering, construction, and geospatial.
Note
Our current support for DGN file format is provided as alpha version.
How to Import from DGN
To load a DGN file, use A3DAsmModelFileLoadFromFile()
.
The A3DParamsLoadData
structure is used to customize the loading behavior:
A3DAsmModelFile* pModelFile = 0;
A3DRWParamsLoadData sReadParam;
A3D_INITIALIZE_DATA(A3DRWParamsLoadData, sReadParam);
sReadParam.m_sGeneral.m_bReadSolids = true;
// ... set other A3DRWParamsLoadData fields as necessary
A3DAsmModelFileLoadFromFile("path/to/file.dgn", &sReadParam, &pModelFile);
See Simple Load and Export for more about loading model files.
B-rep
DGN format does not store the geometry as tessellation or boundary representation. Instead, we have an exact definition of how to create the geometry ex: definition of an extrusion, a revolution, a B-spline surface, etc.
HOOPS Exchange interprets these various geometry definitions and translates them into B-rep models.
Levels
We provide support of items visibility based on the level they are attached to.
In the DGN format, each item is attached to a level. In the PRC structure, we create a separate layer for each level, assigning a layer id that corresponds to the level number. We set the layer id of each A3DRiRepresentationItem
or A3DAsmProductOccurrence
to match the level number of its counterpart in the DGN file. To manage layer visibility, a filter is applied on the root A3DAsmProductOccurrence
to control the visibility of different layers, based on the GlobalDisplay and GlobalFreeze settings of the respective level in the DGN file.
Limitations:
- Currently, only the GlobalDisplay and GlobalFreeze settings are supported for controlling level visibility. The ViewDisplay setting is not yet handled.
- Level numbers greater than 65,535 are not supported. These levels will not be assigned to any
A3DRiRepresentationItem
orA3DAsmProductOccurrence
, and will not be included in the default filter layer list. - The level number of Smart Geometries is currently not extracted nor assigned to their corresponding
A3DRiRepresentationItem
orA3DAsmProductOccurrence
. - Changes to color, style, transparency, or material based on level are not yet supported.