Levels And Level Libraries

Document Information

Document Type: FAQ  

Product(s):  MicroStation V8

Version(s):  All

Original Author: Bentley Technical Support Group

Legacy Document Number:  6214

What is a Level Library?

A Level Library or Libraries are Design Files that store information such as level manager settings to be used as a standard throughout Design Files.

Where is the Level Library information stored?

Level Libraries are defined in the MS_DGNLIBLIST variable with an *.dgnlib extension. This functionality works similar to cell and font libraries where these files can be setup by the CAD administrator for setting up level names, symbology, etc. Level Libraries allow for multiple files to be changed globally.

 What is the difference between attaching a Level Library and importing a Level Library?

Attaching a Level Library is different than importing a Level Library since the levels are not physically a part of the Design File. However, levels from an attached Level Library can be copied over to the active Design File by double clicking on the level from the attached Level Library in the Level Manager.

Importing a Level Library copies the entire level structure over to a Design File. Whereas attaching a level library, allows individual levels to be copied.

How can I determine if I have Level Libraries attached?

A check mark in the Level Manager under the Library column will indicate that a level is from the Level Library. This is an indicator that this particular level is being read from the MS_DGNLIBLIST variable as one of the standard levels.

 How do I set up the Level Library configuration variable - MS_DGNLIBLIST?

MicroStation V8 has a variable called MS_DGNLIBLIST that searches for a Design File that has been setup to be used as a standard throughout the creation and manipulation of files on a global basis. To get to the configuration variable, go to the Workspace > Configuration menus. Next, look for MS_DGNLIBLIST variable list. Next, you can hit the Select button to navigate to where the Design File that contains the standards.

 Is MicroStation V8 limited to 63 levels?

No. MicroStation V8 now allows levels to be saved on a name basis instead of the previous number based system. Prior to MicroStation V8, MicroStation was limited to 63 levels that elements could be placed on. Now the number of levels that can be created is practically limitless as long as the level name is unique compared to other level names.

 Does MicroStation V8 have the ability for ByLevel attributes?

Yes. Another addition to MicroStation V8 is the ability to have elements be placed on a level with ByLevel Attributes. Therefore ByLevel Attributes allow elements to be changed globally between Design Files for the Color, Style and or Weight for the entire level. This can be set through the *.dgnlib file affecting all Design Files that were placed with ByLevel attributes.

 What is the difference between Level Lock and locking a level?

Individual Levels can now be locked in MicroStation V8. Prior to MicroStation V8, Level Lock would lock all of the levels except for the active level. Therefore, no manipulation of elements could be made to any element, unless the element resided on the active level. However, in MicroStation V8, you can toggle on and off individual levels to be locked. Therefore, not limiting you to the active level. The regular Level Lock still works like previous versions of MicroStation where all but the Active Levels are locked from modification.

To lock a level, go in the Level Manager and navigate to the column that is named Lock. Next, click on the level in the column that you want to be locked. A black padlock will appear indicating that this level is locked.

An alternative way to lock a level is to Select the particular level that you want to lock and right-click on the level name. Go to the Properties section and turn on the Lock toggle and then hit Apply. The Level is now locked.

Elements can be placed on this locked level, but cannot be modified since it is locked. A quick way to determine if a Level is locked is to go the Level Display pulldown from the Attributes tool strip. A black Padlock will display next to the level name indicating that the level is locked.

How do you attach a Level Library?

Level Libraries can be attached to Design Files by going to the Levels pulldown menu of the Level Manager and then selecting Level and then Attach. Then navigate to where the Level Library Design File is located and this file will be attached.


How do you detach a Level Library?

Level Libraries can also be easily detached by going to the Levels pulldown menu of the Level Manager and then selecting Level and then selecting detach. Next, select the library that you want to detach.



How do you import a Level Library?

A Level Library can be imported into MicroStation V8 by going to the Levels pulldown menu from the Level Manager and select Import. This will open the Import Level Library dialog box. Next, navigate to the file that contains the library to be imported. Once the file is located and the OK button is selected. This will allow you to import an existing Level Library from a separate Design File into the active file. These levels are now a part of the active Design File.


How do you export a Level Library?

A Level Library can be exported from a Design File by going to the Level Pulldown menu and selecting Export. From here you can export the Level Library to a separate Design File since a Level Library is a DGN formatted file.


How do you set up a Level Library for Administrative Use? (Locking The *.dgnlib for limited use and read-only).

Once the Level Library is set in a Design File that has the extension *.dgnlib, this file can then be set with permissions to allow only certain users access to the file. For example the CAD Administrator would have permissions to make changes to the Levels in *.dgnlib file. Therefore, essentially making this file accessible to users as a read-only, where the levels can be utilized, but any modification is inaccessible.

Setting this file up as administrative levels allows for control over the Design Files that are created. For example, if a level override name needs to be modified and this level was changed on the administrative level. Essentially, all of the Design Files that utilized this Level Library will be affected globally. Any change or modification can be made very easily and quickly affecting a few files to hundreds of files. MicroStation V8 makes modifying levels through a Level Library very powerful administrative tool.

How do you Modify or Update a Level Library?

To modify a Level Library, open up the Design File that has the extension *.dgnlib and contains the Level Library to be modified (it should be located in a path defined by MS_DGNLIBLIST). Once this file loaded, modifications to a Level can be made through the Level Manager. Once the changes have been saved, the Level Library is now updated. Note: If a Level Library has been modified, the changes will not automatically be reflected in the Design Files that have a connection to the particular level or levels that have been modified. In order to have the modifications show in the connected Design Files, a keyin must be used: dgnlib update levels

In addition to using the key-in, the Level Manager provides a way to update the levels. In order to synchronize the levels in a design file to a level library, you can open the Level Manager and then select the Update Level From Library icon.

On an administrative side, Level Libraries can only be modified by the person who has permissions to modify *.dgnlib file.

Onto which level will elements be placed when copied from a reference?

By Default, under the Workspace>Preferences>References the Copy Levels During Copy is set to If Not Found. Therefore, if the levels are not found within the file that the reference element is being copied into, then a new level will be created.

The Copy Level During Copy can also be set to If Overrides Exist. With this setting the Levels are copied from the reference if the level does not exist in the active model, or if the settings for the active model level are different than those of the attachment. Differences include overrides that have been applied to the attachment levels, or differences between the levels as defined in the active model and reference.

Another setting is Always. With this setting the reference levels are copied even if an identical level exists within the active model

What is the difference between the MS_V7TOV8_CSVNAME technique and the "Save As Remapper"?

The following should help further distinguish between the functionality's provided by MS_V7TOV8_CSVNAME & the save As remapper:

<!--[if !supportLists]-->1.       <!--[endif]-->The MS_V7TOV8_CSVNAME techniques gives a way to transition V7 levels to V8. In particular it provides a way to name V7 levels & to assign values to new V8 level attributes (In hindsight, the name MS_V7TOV8_CSVNAME is much too generic for its intended purpose. It should have been something like MS_V7TOV8_LEVELCONVERT).

The level remapper gives a way to remap levels of elements. It is part of the complete remapper that allows to remap colors, weights, etc.

<!--[if !supportLists]-->2.       <!--[endif]-->The MS_V7TOV8_CSVNAME is invoked when opening a V7 file in V8.The remapper is invoked when "saving as" a file into another file.

<!--[if !supportLists]-->3.       <!--[endif]-->Both use .csv as a common underlying format, but expect different columns. The remapper format is more sophisticated in that the .csv file sub-divided in multiple sections, with each section specifying a particular type of remapping.

The best way to create the .csv file for MS_V7TOV8_CSVNAME is to use the Levels > Export function in the level manager.

The way to create the .csv file for the remapper is to use the embedded Excel VBA app that can be invoked from the "remap" option of "Save As" functionality.

When using the batch converter on V7 files, both the MS_V7TOV8_CSVNAME technique & the remapper can be invoked. The MS_V7TOV8_CSVNAME technique is invoked by the batch converter when opening the V7 file. The remapper is invoked when saving the data to the specified file.

How can I control my level information when converting from a MicroStation V7 file to a MicroStation V8 file?

There are three possible controls that can be used -- each is controlled by setting a configuration variable. All three variables are explained in detail below.

<!--[if !supportLists]-->1.       <!--[endif]-->MS_V7_LEVEL_NAME_PREFIX: In MicroStation/J, a level need not have a name. So on conversion, each level is given a name "Level xx" where xx is its level-number. The "Level" prefix can be overridden by setting the MS_V7_LEVEL_NAME_PREFIX. Thus if the variable is set to "my-level", then each MicroStation/J level that does not have a number will be given a name "my-levelxx". The variable can be set to "", which would cause every unnamed MicroStation/J level to have a name which is the same as its level-number.

<!--[if !supportLists]-->2.       <!--[endif]-->MS_V7TOV8_CSVNAME: If this variable points to a valid ".csv" (comma separated value) file, then level information is picked up from this file.

Essentially the .csv file is a list of levels. For each level, the possible information that can be specified is Number, Name, Description, OverrideColor, OverrideStyle, OverrideWeight, ByLevelColor, ByLevelStyle, ByLevelWeight, GlobalDisplay, Lock and Plot. Each level attribute is arranged by columns. The first line of the .csv file should be a header line which specifies the names of the individual columns.

The minimum columns expected in the .csv file are the "Number" and "Name" columns. All the other columns are optional. If a particular column exists, then it overrides the level information of the MicroStation/J file. Thus if the OverrideColor column exists, then the level override color in the MicroStation/J file is replaced with the information from the .csv file.

MS_V7TOV8_CSVNAME is a good way to standardize your level information when transitioning design file information from MicroStation/J to MicroStation V8.

The .csv file can have a "Required" column. Under the "Required" column, each level can have a 0/1 value. If the level has a "1" value under the required column, then that means that the level is a required level. If the level has a "0" value (or no value) under the required column, then that means that the level is deleted if the level does not have any elements on it. The "Required" column is optional. If it does not exist, then it is like setting a "0" value.

A .csv file can be created in MicroStation V8 using Levels Export from the Level Manager. This will create a .csv file with all the possible columns, except the "Required" column. The "Required" column may then be added using Excel.

<!--[if !supportLists]-->3.       <!--[endif]-->MS_V7TOV8_DELETE_UNUSED_LEVELS: If this variable is set to "1", then all unused levels (i.e. levels that do not have any elements on it) are deleted. This variable is active only if MS_V7TOV8_CSVNAME is not set or is set to an invalid file.


How can level-related configuration variables be controlled?

The Workspace > Configuration... dialog includes a "Levels" category, which provides the ability to access and modify the following level-related configuration variables:

Configuration Variable

Short Description

Long Description


Control Level Attribute Sync

Controls the list of level attributes that will automatically synchronize when a file is opened.



Control Level Attribute Sync

When set to 1, reference attachment levels will not synchronize to an attached library.


Level Library Path

Defines the default directory to look for when exporting levels or importing levels to/from a .csv, .dgn or .dgnlib file.


V7 to V8 Level Name Prefix

Defines the prefix to apply to un-named Levels when a V7 design file is upgraded to a V8 DGN file.


V7 to V8 Level CSV File

Defines the .csv file which control how levels are mapped when a V7 design file is upgraded to a V8 DGN file.


V7 to V8 Delete Unused Levels

If set to 1, then all unused levels are deleted when a V7 design file is upgraded to a V8 DGN file. This variable is ignored if "V7 to V8 Level CSV File" variable is set.


Control Level Attribute Sync

Affects the "dgnlib update levels custom" and "reference synchronize levels default" key-ins. This variable controls the list of level-attributes that will sync-up when any of the above key-in is executed. The attributes can be one or more of the following as a comma separated list: OverideSymbology, OverrideColor, OverrideStyle, OverrideWeight, ByLevelSymbology, ByLevelColor, ByLevelStyle, ByLevelWeight, GlobalDisplay, GlobalFreeze, Lock, Plot.


Control Level Attribute Sync

Controls which of the level attributes can be edited or overridden. The attributes to be edited can be one or more of the following as a comma separated list: OverrideSymbology, OverrideColor, OverrideStyle, OverrideWeight, ByLevelSymbology, ByLevelColor, ByLevelStyle, ByLevelWeight, GlobalDisplay, GlobalFreeze, Lock and Plot.

What's the difference between Global Display OFF and Global Freeze ON?

The difference between Global Display OFF & Global Freeze ON is that, Global Freeze is a stronger condition as follows:

(A) When a level's global display is OFF, then this does not affect the nested elements of a shared cell instance, if the nested elements are not on the same level.

On the other hand, when a level is frozen, then nested elements of a shared cell instance are also not displayed, irrespective of the level of the nested element.

(B) A DWG attachment can be on a level. The attachment's display can be controlled by freezing the level.


What do the different colors for a level in the Level Display mean?

Definitions of the different color is outlined below.

Black = the Level is ON.
No color = the level is currently turned OFF.
Gray highlight = the level is ON in some of the views and OFF in the other views.

How many characters can a level name have?

The maximum length of a level name is 511 characters.

Which characters are not allowed in a level name?

For the MicroStation V8 file format - unless otherwise noted, one or more of the following characters are not permitted in level names:

Ampersand ( & )
Asterisk ( * )
Vertical bar ( | )
Backslash ( \ )
Forward slash ( / )
Period ( . )
Less than ( < )
Greater than ( > )
Single quotation mark ( ' )
Double quotation mark ( " )
Question mark ( ? )
Comma ( , )
Equal ( = )

Note: Although MicroStation does not allow the usage of these characters, it is possible to receive a file that contains them. In this case, the model or level may be problematic and require you to remove the offending characters before proceeding. This is especially true when dealing with DWG files or ex-DWG files.

Is there a way to create a new level from a seed level if I don't want to have the levels be created from the attributes of the default level?

Yes, if you have the configuration variable MS_LEVEL_SEED_LEVEL_NAME set to the level that you want as the seed level, then the new level will be created using the attributes from this seed level. If this configuration variable is not defined, it will use the Default level to create the new level and use the attributes of the default level.

When I create a level, how do I control what attributes are used for the new level?

When a new level is created, the Default level controls which attributes the new level is going to be created with. The Default level will act like a template. Therefore, whatever override or bylevel, color, style, or weight is set for the Default Level, the new level will be created with these attributes.

In addition to the settings defined in the Default level, if the configuration variable MS_LEVEL_CREATE_FROM_SEED_ATTRIBUTE_LIST is set, the new level will take the settings defined in this variable.

Can I edit the level attributes of Nested Reference Files for the Symbology and ByLevel Settings?

Yes, in MicroStation V8.5, you can edit the nested reference file levels symbologies by setting the MS_LEVEL_ EDIT_NESTED_ ATTACHMENT_LEVELS. If you set this to 1, then you will be able to edit the nested levels.

Why do my changes to the override or bylevel settings for a reference file do not stay when I exit out of the design file and re-enter?

You want to make sure that the reference file level overrides have been set to ON to allow this functionality for the master file. If you go to the key-in Window and type in: SET REFLEVELOVERRIDES ON, this will turn this setting on so that any override change for the reference file made in the master file will remain. You can check to see what the master file is currently set to by typing in: SET REFLEVELOVERRIDES and then selecting enter. The value will appear in the Message Center.

What happens to my V8 files levels when I save it to V7 if there are more than 63 levels?

The elements that are on levels beyond level 63 will be placed on levels that will wrap around starting with level 1. For example, if you have elements on level 64, the elements will be placed on level 1 when the file is saved to V7.

When I try to delete a level, the Message Center is stating that the level is being used. How can I determine where the level is being used at?

You can use the key-in: LEVEL USAGE <level name>. Where you substitute <level name> for the name of the level that you are trying to gather information on. In some cases, the levels may be used by Shared Cell Definitions. You can remove the shared cell definitions from a design file by using the key-in: DELETE SCDEFS ALL.  

General Note for specifying level names in key ins:
In case the level name that you want to specify contains spaces, always use double quotes when entering the name.
Level name in the Level Manager is shown as: Roof of house, make sure to enter:
"Roof of house"

Is there a way to remove all of my unused levels at one time?

Yes, there are a couple of methods. One way is to select multiple levels from the level manager by holding the CTRL button down when selecting the levels and then selecting the delete button. An alternative way is to use the key-in: DELETE UNUSED LEVELS or use the updated Compress functionality of MicroStation V8 2004 Edition found under the File > Compress menu.

What does the Level Purge key-in do?

If the key-in: level purge [dest:level-spec] level-spec is used where you would substitute <level name> in for the name of the level, the specified level will be deleted from the design file. If elements exists on the level, then the elements will be moved to the Default level before it is removed from the design file.

An alternative key-in: Level Purge [Destination Level] <Level Name> syntax will move the elements, if they exist to the specified destination level.

Use double quotes when you specify a level name that contains spaces. Example: "House with roof"

Is there a way to delete all of the elements on a level, but have the level name remain?

There is a couple of ways to do this. One way is to toggle off all of the levels to isolate the level that contains the elements and then remove the elements from the design file. An alternative way is to use the key-in: LEVEL ELEMENT DELETE <Level Name>. This key-in will remove all of the elements from the level specified, but will leave the level name in the design file.

What is the syntax for the Comma, Separated List when I setup the MS_LEVEL_SYNC_ATTRIBUTE_LIST variable?

If you want to have just the Level Library or Reference file's attributes be the only attributes that are synchronized, the syntax Level or Reference can be added as a prefix before the attribute. For example, to synchronize the Override Color and Weight for a reference file, the syntax would be:

MS_LEVEL_SYNC_ATTRIBUTE_LIST = referenceOverrideColor,referenceOverrideWeight

Is there a way to have all of my levels be automatically synchronized when I open a design file?

Yes, if you have the MS_LEVEL_AUTO_SYNC_ATTRIBUTE_LIST defined this will automatically synchronize the attributes listed here when a dgn file is opened. The attributes listed can have a library or reference prefix as well. If no prefix is defined, both the library and reference file levels will be automatically synchronized. See Question "Is there a way to delete all of the elements on a level, but have the level name remain?" for syntax example of adding a prefix to the attribute listing.

Why is that when I toggle on some of the overrides in a V7 file used in MicroStation V8 using the V7 workmode, that when I re-enter the file, my overrides are all off?

MicroStation V7 files worked in which all overrides for a particular attribute were all on or all off. With MicroStation V8, there is the ability to have the override be on or off for each single level. Since MicroStation V7 did not support this, all of the levels for an attribute override must be all on.

When I create new levels in my reference file, how do I control whether or not these levels appear in the active file to which they are being referenced?

When a new level is created in a design file, the level is automatically set to display the new level in versions before MicroStation 08.01.02.xx. However, with MicroStation 08.01.02.xx and later, the configuration variable MS_REF_NEWLEVELDISPLAY can be used to control how the new level is displayed. If the variable is set to 1, newly created levels will Display ON in all Models that contain references with levels created after the time of attachment. If the variable is set to 0 or not set (default), newly created levels do not appear in any files referenced to the master file.

What is the difference between the Level Manager and the Level Display?

Level Manager is a tool that allows you to manage and maintain your levels within a design file by creating, deleting, renaming, etc... levels. Level Display is a tool that allows you to quickly turn levels on or off per view.

Why is it that my Level Manager displays all of the levels in the Global Display column as checked on, but the levels do not appear on in the view?

The Global Display column in the Level Manager allows the levels to be turned on or off in the Level Display. If the Global Display is off for a level in the Level Manager, the level in the Level Display and will be grayed out and cannot be turned on. Therefore, if the Global Display is toggled on in the Level Manager, it does not necessarily mean that the level will be on. You may need to open the Level Display tool and turn the levels on.

Is there a way to make the level display use the number map only when using V7 files?

Yes. There is a new configuration variable that has been added to 08.05.01.XX that will allow you to control this. The variable is: MS_LEVEL_DISPLAY_MODE_V7MAP_V8Names.

If this variable is set 1, the workmode will determine what level display will be used. For example, if the workmode is set to V7, the level display will be in the number map format.

If this variable is set to 2, the level display format will be based upon the file type. If a V7 file is opened, the level number map will be displayed. If a V8 dgn file is opened, the level name display will be shown for the level display.

Is there a way to copy levels from a level library to the active file when changing an attribute in the active file?

Yes. You can set the MS_LEVEL_ALLOW_LIBRARY_LEVEL_EDIT variable to 1. When set, changes to library level attributes will cause the library level to be copied into the active file. This allows the changes to the library level attributes to be saved in the active file.

What does the MS_LEVEL_KEEP_UNUSED_LIBRARY_LEVELS variable control?

This variable controls if the unused library levels will be kept or deleted when using the "dgnlib update levels" command. If not set or set to "0" then, unused library levels will be deleted upon executing the "dgnlib update levels" commend. If this variable is set to "1" then unused library levels will be kept. If set to "2" then unused library levels will be kept only if some attributes of the library level has been modified.

Can you change the reference file at the operating system level?


A number of users have a workflow by which they replace an attachment file with another. MicroStation supports the ability to "re-attach" an attachment - supported by the reference dialog. Some users may prefer to replace the attachment file at the OS level, without the knowledge of MicroStation. This causes the problem where level-masks can get out of sync if the level structure in the attachment file is modified. Levels that were once on/off in the reference file may now appear to the contrary

of the original reference level attachment.

The following keyin should be run: reference filechange <name of reference file or logical name>

This key-in should be run in the master-file that contains the attachment. The key-in takes the name of the attachment file as a parameter. The attachment file parameter syntax is the same as that for other "reference" related key-ins. The key-in can be run either interactively (in MicroStation) or in batch mode on all files that attach to the switched file.


The key-in attempts to rebuild the level-masks after the attachment file has been switched at OS level. It looks in the master-file for all level masks associated with the specified attachments & remaps each individual level-mask to reflect the modified level structure. The modified level-masks are then written back to the active-file.


This key-in should be run immediately after swapping the file at the OS level. If the keyin is run after opening and modifying the master-file that has the attachment, then the chances of the key-in correctly are unlikely.


Known limitations:

1.) The key-in fixes levelmasks for primary attachments only.

2.) The attachment needs to be a DGN file.(Currently it will not work on nested attachments or attachments which are DWG files)


See Also

Product TechNotes and FAQs

MicroStation Desktop TechNotes and FAQs

External Links

Bentley Technical Support KnowledgeBase

Bentley LEARN Server

Other language sources


Comments or Corrections?

Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!