101 - DGNLIB (Design File Libraries)

A DGNLIB is a DGN file used for the storage and distribution of shared resources. Its internal structure is identical, only the file extension is different. Files with the .dgnlib extension are treated differently within Bentley applications. For instance, since MicroStation XM Compress Design does not affect DGNLIBs.

DGNLIBs first appeared in the original MicroStation V8 release and were only used for storing levels. Since then many other uses have been developed for them.

Prior to DGNLIBs CAD Standards were largely distributed via seed files. Now the only things that really need to be in seed files are design file settings.

This makes life easier as one library of say, levels, is shared by an entire organization. Previously if a level changed all of the individual files that used it might need to be updated.

What Can They Store?

Some of the resources that can be stored in DGNLIBs are:

  • Levels and Level Filters
  • Text Styles
  • Dimension Styles
  • Line Styles
  • Multi-line Styles
  • Cells
  • Color Books
  • Display Styles
  • Print Styles
  • Detailing Symbol Styles
  • Element Templates
  • Project Explorer Linksets
  • Standards Checker settings
  • Visualisation - Rendering Settings
  • Visualisation - Materials
  • Visualisation - Light Setups
  • Interface - Menus, Tools and Tasks

Where are They Located?

We deliver DGNLIBs that are necessary for operation during installation in the locations listed below.

  • C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\*.dgnlib
  • C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\ustation.dgnlib
  • C:\ProgramData\Bentley\MicroStation V8i (SELECTseries)\WorkSpace\system\GUI\*.dgnlib
  • C:\ProgramData\Bentley\MicroStation V8i (SELECTseries)\WorkSpace\system\dgnlib\*.dgnlib

These files should never be edited.

They do not need to be edited in any case as they can be overwritten or added to by site or project specific DGNLIBs when required.

We also define paths where DGNLIBs can be found for each project, e.g.:

C:\ProgramData\Bentley\MicroStation V8i (SELECTseries)\WorkSpace\projects\untitled\DGNLIB\*.dgnlib

And for interface specific DGNLIBs,, e.g.:

C:\ProgramData\Bentley\MicroStation V8i (SELECTseries)\WorkSpace\interfaces\MicroStation\default\*.dgnlib

These locations can vary according to the application, interface and project in use.

Additionally we deliver a folder:

C:\ProgramData\Bentley\MicroStation V8i (SELECTseries)\WorkSpace\Standards\dgnlib

designed for storage of site standards. In most cases this Standards folder will be located on a network share. See MicroStation - QuickConfig Standard for an example of this.

AECOsim Building Designer users also have the option of a Company DGNLIBs folder specific to AECOsim Building Designer as discussed in Configuring AECOsim Building Designer #3 – Put a Company Dataset on the network and AECOsim Building Designer - QuickConfig Standard.

One Big DGNLIB or Multiple DGNLIBs?

This can depend on the scale of your organisation, whether you often work with other users CAD Standards or simply personal preference.

The simple approach is to put everything in one library. However if on a project you need to use a client’s standards, you will then have to separate out the relevant parts.

I think the modular approach is the most manageable, and bear in mind that once your libraries are set up, they should not need frequent management. Also as the number of element/settings types that can be stored in a DGNLIB has grown the single DGNLIB approach has become less attractive.

What DGNLIBs do I need to add to my system?

The basics are:

  • Levels and Filters
  • Text and Dimension styles
  • Line styles
  • Print Styles

Precedence

DGNLIBs can be read from locations at the application, site (also for AECOsim Building Designer, company) and project levels. If a library element, say a level, exists with the same name in more than one library, MicroStation will use the first instance of that level it finds. The order in which libraries are read can be important. Here the use of operators with the MS_DGNLIBLIST variable can be important.

Generally the Project Configuration File (PCF) should contain something like:

MS_DGNLIBLIST < $(_USTN_PROJECTDATA)dgnlib/*.dgnlib

Where the project folder defined by _USTN_PROJECTDATA contains a folder called dgnlib.

The < operator tells MicroStation to read the project DGNLIBs first

The site standards.cfg should contain

MS_DGNLIBLIST < $(_USTN_SITE)dgnlib/*.dgnlib

The < operator tells MicroStation to read the site DGNLIBs first

Do not set either of these using = as the operator, that will exclude DGNLIBs from other locations leading to all sorts of possible errors.

Tips:

  • Use Windows Folder permissions to keep your DGNLIBs read only to users. If you don’t do this your CAD Standards will not be standards for very long! I also suggest using a specific CAD admin user to manage DGNLIBs (and the whole CAD workspace), especially where the CAD admins also carry out design work, it’s easy to make inadvertent changes to standards in that situation.
  • Keep Text and Dimension styles in the same DGNLIB. Dimension styles use your text styles so attempting to keep a separate text styles DGNLIB will result in the text styles being copied into the dimensions DGNLIB.
  • Use structured file naming for your DGNLIBs, e.g:
    • Company_LevelsFilters.dgnlib
    • Company_TextDims.dgnlib
    • Company_LineStyles.dgnlib
    • Company_PrintStyles.dgnlib
  • Note Color Books are located by another variable, to make your show up at the top of the color book list use this statement:
    MS_COLORBOOK_LIBRARIES < $(_USTN_SITE)dgnlib/*.dgnlib)
  • DGNLIB Import/Export.
    Levels can be exported to CSV. It is often easier to create, organise and modify your levels in excel, using the series copy and concatenation functions for example.
    Color Books are easier to create in CSV, see MicroStation - Creating a Custom Colour Book. The CSV is then a useful backup/record.
    User interfaces customisations and Element Templates can be exported to XML.
    Some of the styles dialogs have import options, these are covered by the help documents.

Updating Library Content

The following commands can be used to update the listed types of content:

DGNLIB UPDATE LEVELS/MLINESTYLES/TEXTSTYLES/DIMSTYLES/DETAILINGSYMBOLSTYLES/TEMPLATES/ALL

Levels can also be set to synchronise with their source library using the synchbylevel MDL controlled by a series of variables. That will be covered in another article.