About MSCONFIG.CFG

By dgnviewer.com

The MSCONFIG.CFG file is the main configuration file of MicroStation. Upon completion of processing this file, MicroStation starts. It is important to understand this file as it shows us the structure and methods MicroStation uses to configure itself.

WARNING: DO NOT EDIT THIS FILE.

  • Open the file MSCONFIG.CFG in Notepad. The contents of this file start with several lines of comments. Comments are identified by the # character. Go to line 34 and locate the lines:
#---------------------------------------------------------------------- #
# Levels are defined as follows:
#0) System Level
#1) Application Level #2) Site Level
#3) Project Level
#4) User Level
#

Although this is only a comment it does provide first insight into how the overall MSCONFIG file is organized.

  • Go to line 66 and locate the lines: Note that all of these variables use the conditional equals “:” which means set if not already set otherwise ignore.
#----------------------------------------------------------------------
MSDIR : ${_ROOTDIR}/
MSLOCAL : $(MSDIR)
_USTN_BENTLEYROOT : ${parentdevdir {MSDIR}} 
_USTN_WORKSPACEROOT : ${_USTN_BENTLEYROOT}WorkSpace/ 
_USTN_HOMEROOT : $(_USTN_LocalUserAppDataPath) 
_USTN_DOCUMENTATIONROOT : ${_USTN_BENTLEYROOT}Documentation/

Note the following:

  • _USTN_BENTLEYROOT is the parent drive and folder of MSDIR.
  • _USWORSPACEROOT was set earlier and is thus ignored.
  • _USTN_HOMEROOT uses a Windows variable LocalUserAppDataPath, found under C:\Users... to set the local temp files locations, including the UPF file.
  • _USTN_DOCUMENTATIONROOT sets the location of Help files.
  • The _USTN_WORKSPACEROOT configuration variable points to the root directory for all of the workspace components. By default, it is C:\ProgramData\Bentley\MicroStation V8i (SELECTseries)\WorkSpace. However, there is a command line modifier you can add to the MicroStation shortcut to redirect to a different location (-wr).

  • Go to line 78 and locate the following lines:
_USTN_SYSTEM : $(MSDIR)config/system/
_USTN_APPL : $(MSDIR)config/appl/
_USTN_SYSTEMROOT : $(_USTN_WORKSPACEROOT)system/ 
_USTN_SITE : $(_USTN_WORKSPACEROOT)standards/ 
_USTN_PROJECTSROOT : $(_USTN_WORKSPACEROOT)projects/ 
_USTN_PROJECT : $(_USTN_PROJECTSROOT)
_USTN_PROJECTDATA : $(_USTN_PROJECT)$(_USTN_PROJECTNAME)/ 
_USTN_OUT : $(_USTN_PROJECTDATA)out/
_USTN_USER : $(_USTN_WORKSPACEROOT)users/ 
_USTN_USERINTROOT : $(_USTN_WORKSPACEROOT)interfaces/ 
_USTN_USERINT : $(_USTN_USERINTROOT)$(_ENGINENAME)/ 
_USTN_CHARTRAN : $(MSDIR)chartran/
_USTN_LICENSING : ${_USTN_BENTLEYROOT}/Licensing/ 
_USTN_SYSTEMTABLES : $(_USTN_SYSTEMROOT)tables/ 
_USTN_RASTERTABLE : $(_USTN_SYSTEMTABLES)raster/ 
_USTN_RASTERGDALDATA : $(MSDIR)GeoCoordinateData/Gdal_Data/ 
_USTN_HOMEPREFS : $(_USTN_HOMEROOT)prefs/
  • Use EXPAND ECHO $(varname) in the Key-in Browser to see the expansion of these variables.
  • The _USTN_SYSTEMROOT points to the System folder under …\WorkSpace. The _USTN_SITE points to the standards folder also under …\WorkSpace and, finally, the _USTN_PROJECT and _USTN_PROJECTSROOT point to the Projects folder. As you can see, MSCONFIG.CFG is very important.
  • Continuing, go to line 140 and locate:
%level 2
%if exists ($(_USTN_SITE)*.cfg) 
% include $(_USTN_SITE)*.cfg 
%endif

The if…endif denotes a conditional check and, if successful, the action to take. In the previous example the “%If exists…%endif” says if the file exists, then include its contents in this macro at this point. Also note that this conditional check accepts a wildcard definition both for the conditional check and for the response. That means that any files with the .cfg extension will be processed by the Include statement.