Locking Variables

By dgnviewer.com

Once a configuration variable has been set, and you know that it should not change for the rest of the MicroStation startup, you need some manner of locking that variable. Because of MicroStation’s use of the system/application/site/ project/user approach, something you set at the site level can be overwritten by the same variable being set at the project or user level. Whenever you have a configuration variable for which you absolutely need to use a specific value, you can add the following line right after its definition:

%lock CONFIG_VARNAME

  • Continuing in MSCONFIG.CFG, scroll down to this section of the macro:
%level 4
%if exists ($(_USTN_USERCFG))
% include $(_USTN_USERCFG)
%else
% if exists ($(_USTN_USER)$(_USTN_USERNAME).ucf) _USTN_USERCFG = $(_USTN_USER)$(_USTN_USERNAME).ucf % include $(_USTN_USERCFG)
% else
% if exists ($(_USTN_USER)untitled.ucf) _USTN_USERNAME=untitled
% include $(_USTN_USERCFG)
% else
% error Exiting, $(_USTN_USERCFG) not found
% endif
% endif
%endif
%lock _USTN_USERCFG

Once a user configuration file has been found, MicroStation locks down that value.

  • Exit Notepad.