Configuration files are text-based files that allow MicroStation to be set-up for office standards and enable additional customisation for project-specific folders and settings. There are different types of configuration files which can be located in various locations on the user’s local machine or a shared network drive for easier centralised management.
When MicroStation (or other Bentley products) starts up, it processes each of the configuration files in turn as shown below.
- Configuration files in red should not be edited.
- Each consecutive level of configuration overwrites or adds to any variables defined in previous levels.
- Each consecutive configuration file overwrites or adds to any variables defined in previous files.
- The user configuration file (personal.ucf) is processed before the Workspace and Workset (project) as it is the .ucf that tells MicroStation which project needs to be loaded. However, the User-level configuration variables take precedence over all the other level settings.
The main configuration files
To customise Bentley resources to use a shared network location, the following configuration files need to be created or edited:
This .cfg file sets the path to a custom Configuration folder. The following line needs to be edited to point to the shared network folder:
Replace Drive:/Folder/ with the full path to the Configuration folder.
The Standards.cfg in the root of the Configuration\Organization\ folder defines all company search paths and files to customise how MicroStation operates. Any .cfg at this level will change settings for all projects (worksets) and workspaces.
Take the time to go through each configuration used and understand fully what it means. Comments can be added to help using #. Anything after # on a line will be ignored.
Order the Standards.cfg logically so it is easier to find configurations later. Evolve use the example groupings below and then list any configuration in alphabetical order:
- System (_USTN_) variables
- MicroStation (MS_) variables
- MicroStation folders
- MicroStation files
- Additional settings
- Project configuration variables
A Workspace is a group of projects (worksets) that use identical standards. This might be for a specific client’s standards, or to split out projects in different countries, or updates to UK-based standards, for example, projects using BS1192 levels and those using ISO13567.
Each Workspace folder should have an identically named workspace .cfg that will automatically process when it is selected in the MicroStation start screen.
Any configurations set at this level will override the organisation-level Standards.cfg.
A Workset is a project. A workset .cfg needs to exist for each project or it will not list in the start screen. It should contain any variables that need to be unique for this one project. Any variables that need to apply to multiple projects should be added into either the Workspace (if the setting is for all projects of that grouping) or Standards.cfg (if it applies to all projects).
For example, if the name of the seed file used is unique for the single project, configure MS_DESIGNSEED in the workset .cfg.
However, if the same seed file is used for all projects for a specific client, even if each project has its own copy, this can be done once in the workspace .cfg.
You can set the same variable in all .cfg files. Each will progressively override the previous one as needed. More on levels of configurations below.
There are four main types of configuration variable:
The easiest type of configuration is one that has optional settings. Typically this would need a value of either 1 (on) or 0 (off). An example of a configuration variable setting is:
MS_FULLPATHINTITLEBAR = 1
This variable shows the full path of the open file across the top of the MicroStation window if set to 1. If set to 0, it shows the file name only.
Folder path variables specify the location of files which MicroStation either needs to load, or where to save an output. MicroStation uses / to separate folders. Each folder path should end with a /. For example:
MS_CELL = S:/OfficeStandards/Configuration/Organization/cell/
MS_CELL tells MicroStation where to search for cells and cell libraries.
Folders can either be individual paths or a list of possible locations.
Variables of this type point to a specific file rather than a folder. Typically a file name configuration can have only one value.
MS_DESIGNSEED = XXXXX-EVOLVE-XX-XX-M2-A-Seed.dgn
This variable defines the default seed file used when creating a new .dgn design file.
System (hidden) configurations:
Certain variables are hidden to avoid them being edited. Variables that begin with an underscore “_” will not be displayed in the Configuration Variables dialog box.
_USTN_WORKSETROOT = $(_USTN_WORKSETSROOT)$(_USTN_WORKSETNAME)\
It is possible to display all hidden variables using:
_USTN_DISPLAYALLCFGVARS = 1
A configuration variable is defined by writing the name of the variable, providing an operator and a value. In the simplest terms that would be:
A variable = a value (where = is the operator).
There are a series of operators which can be used:
= Set the variable to be this value.
> Add another value at the end of the list (or if not yet defined, does the same as =).
< Add another value at the start of the list (or if not yet defined, does the same as =).
: Set the variable only if it hasn’t already been set.
# A comment. Ignore anything after this on a line.
Some examples of this in practice might be:
Configuration variable Result
MS_RFDIR = P:/References/ # P:\References\ MS_RFDIR > P:/XRefs/ # P:\References\, P:\XRefs\ MS_RFDIR < P:/Links/ # P:\Links\, P:\References\, P:\XRefs\
Using existing configuration variables
Rather than writing out full paths, it is possible to use the value of another configuration variable. This is done by surrounding the variable in $( ).
_USTN_WORKSETNAME = 1234 MS_RFDIR = P:/$(_USTN_WORKSETNAME)/
Other commands can also be used in the configuration files. These are known as pre-processors as they come before a configuration.
%include Run an additional configuration file.
%if Provides a choice. If true, then run the configurations immediately below.
%if exist Checks if a file exists. If true, then run the configurations immediately below.
%elif If %if fails then provide another choice. If true, run the configurations immediately below.
%else If %if and any %elif fails then run the configuration below.
%endif Ending all the if statements. Each if statement must have an endif.
%level Allows the configuration level to be changed. The order of processing is:
%lock Locks a variable so it cannot be edited later in the configuration.
%undef Will delete (undefine) a variable.
%if exists (W:\Bentley\CONNECTEdition) _USTN_CUSTOM_CONFIGURATION = W:/Bentley/CONNECTEdition/Configuration/ %else _USTN_CUSTOM_CONFIGURATION = C:/Bentley/CONNECTEdition/Configuration/ %endif
The first %if statement checks that a mapped drive location exists. If the path can be found, the variable _USTN_CUSTOM_CONFIGURATION is set to use this location for the main Configuration folder.
If the path cannot be found (this might be because the PC is disconnected from the network) then the %else statement is used to set the path to the Configuration folder to a local drive.
%if exists $(_USTN_WORKSPACESTANDARDS)_AdditionsForOldprojects.cfg %include $(_USTN_WORKSPACESTANDARDS)_AdditionsForOldprojects.cfg %endif
Checks whether a specific CFG file exists. If it does, set the configuration variables from that file.
Configuration variable Result
MS_RFDIR = P:/References/ # P:\References\ MS_RFDIR > P:/XRefs/ # P:\References\, P:\XRefs\ MS_RFDIR < P:/Links/ # P:\Links\, P:\References\, P:\XRefs\ %lock MS_RFDIR MS_RFDIR < P:/Links/ # P:\References\, P:\XRefs\
Configuration variable Result
MS_RFDIR = P:/References/ # P:\References\ MS_RFDIR > P:/XRefs/ # P:\References\, P:\XRefs\ %undef MS_RFDIR MS_RFDIR < P:/Links/ # P:\Links\
A comprehensive list of configuration variables can be found here: https://communities.bentley.com/products/microstation/w/microstation__wiki/24873/microstation-connect-edition-configuration-variables
How to create a list of all configuration variables: https://communities.bentley.com/products/microstation/w/microstation__wiki/24785/how-to-create-a-list-of-all-connect-edition-configuration-variables