Recently on bentleyuser.org...


About bentleyuser.org

© bentleyuser.org 2024

Printed from www.bentleyuser.org © TMC Publications (UK) Ltd 2010

MicroStation 101 - The Not Quite One Page Guide to Workspace Configurations
by Karen Fugle - 10 March 2004

What are cfg’s?
Nothing to do with chlorofluorocarbons and a lot more user friendly, .cfg’s are the configuration files which let CAD managers customize MicroStation to specific disciplines, projects or tasks (we like control!). If managed from a centralised location they will allow easier management and quicker problem solving.

Ok, what are they?
We will take a look at the four Main configurations, the .ucf, the .upf, the .pcf, and the biggie configuration file – Standards.cfg.

*.UCF = User Configuration File

What does it do?
The user configuration file has two basic functions. First, it specifies the active workspace components, a combination of the user preference file (.upf) and the last project and user interface you were using. Secondly, it contains values for any configuration variables set by you, the user, to control MicroStation's behaviour.

Hang on a minute, what’s a configuration variable?
MicroStation uses configuration variable files (text files) to get values for settings that vary from system to system and from user to user. Each configuration variable has two parts — its name and its definition. For instance, configuration variables can be a path, to tell MicroStation where to find files, or they can point to a directory or where to save files, or they can specify a filename, or they can be a keyword to specify certain default settings.

Where do I find my UCF?
Workspace\Users\

The User name in MicroStation Manager identifies the name of the .ucf it uses.

Your company may use a single user name such as architects.ucf which is stored on each users C drive location and this will be the standard .ucf for all users in the company.

Alternatively, if the user name is set to the individuals log in name (jbloggs) then each individual user can have their own .ucf e.g. jbloggs.ucf that can sit in a centralised location under Workspace\users on your server. You can do this by using the variable; _USTN_USERNAME= $(USERNAME).

What’s in it?
It is made up of Configuration Variables;

Can I have an example?
Here is an individually named Karen.ucf file;

#-------------------------------------------------------------------
# User Configuration File Revision 1.0
# Date 12 Jan 2004
#-----------------------------------------------------------
_USTN_USERINTNAME = architect
_USTN_PROJECTNAME = 1234
These two configs are the last used Interface and project number automatically remembered.
Then I have added capabilities required of a Cad Manager that the rest of my users will not have;
I have locked my users from creating levels and editing in the Level Manager dialog, so I have added these capabilities back into my .ucf


_USTN_CAPABILITY > +CAPABILITY_LEVELS_CREATE

MS_LEVEL_EDIT_ATTRIBUTE_LIST = ByLevelSymbology,OverrideSymbology,GlobalDisplay,GlobalFreeze,Lock,Plot

*.UPF = User Preference File

What does it do?
It saves an individual’s customised preferences. When you choose Workspace>Preferences within MicroStation, the settings in the Preferences Dialog box are personal to the user, rather than maintained across an entire workgroup.

Where do I find it?
Home\Prefs\

NOTE: I keep my .upf together with the .ucf in the Workspace\Users directory and in my Standards.cfg use MS_USERPREF = $(_USTN_HOMEPREFS)$(_USTN_USERNAME)-$(_ENGINENAME).upf

This means that if I log in as Karen I am creating a karen-microstation.upf in my Users directory. This also allows access to my preferences from any pc.

What does it affect?
So far my short list of what the upf stores is as follows

Tool palettes
Which tools are visible.
Workspace>Preferences settings (except the Compatibility tab in MicroStation J)
Window areas (zoom previous/forward)
Key-in's and Accudraw
Last file you were in (If ms_filehistory is on the last four design files)
Last printer driver used (overriding MS_PLTR)
Last seed, cell library (overriding MS_DESIGNSEED)
Last Settings manager .stg file used
Directory where you saved the plot or file (overriding MS_PLOTFILES)
Digitizing setup.
Button Assignments.

I’ve been having problems with corrupt .upf files!
Know what you mean, so what do the bigwigs say on the matter?

Barry Bentley replies to a Discussion Group thread:

"The user preference file has many things in it - obviously the user preferences you set in the Preference dialog, but also window positions, file histories from all the file open dialogs, line style selection history, many MDL application user preferences, etc. It allows finding those little bits and pieces directly and updating them very quickly and efficiently. MicroStation opens, reads and/or writes, and then closes the user preference file many times during a session.
A text file is inherently accessed serially, and every time anything is changed you have to rewrite the whole thing. At least for now, the resource file format we use for the UPF file is a better choice. As I have mentioned several times in various threads, we have put a lot of work into making the UPF file reads and writes more robust, and I believe you will see a big improvement in reliability in V8.5."


Light at the end of the tunnel perhaps? And for any of you lucky enough to have a play around with V8.5 here’s a good tip for you to try courtesy of Mark Coates at Bentley:


"One of the things we have done in the V8.5 Release Candidate that will be available soon is adding a configuration variable that does some diagnostics. When you get the V8.5 RCII, please set the configuration variable MS_MONITOR_USER_PREFS to 1. That causes several tests to be active, including watching for MDL applications that improperly use the user preference file. You should see extra items appearing in the message centre only when information is incorrectly being stored in the upf or the upf file is not being closed correctly after information is written to the upf file."


*.PCF = Project Configuration File

What does it do?
.pcf’s are made up of configuration variables that specify the data files that are particular to that project.

Where do I find it?
Workspace\Projects\

Can I have an example?
Here is an example of the .pcf for project 9999.

#----------------------------------------------------------------------
# Default PCF Template Setup.cfg
# Revision 1.0
# Date 12 Jan 2004
#----------------------------------------------------------------------

# Project Number: 9999
# Description: J Bloggs Garage
# Date created: 12 Jan 04

MPM = drive:/$(_USTN_PROJECTNAME)/

I created an MPM (MicroStation Project Management) variable to make it easier to specify the location of my project directories.
In the Standards.cfg I use MS_RFDIR > $(MPM)plans/ to specify each of my default project directories (such as Plans). All additional folders to the project are specified below.
To make life easier I leave additional information hatched out in the .pcf just in case the project needs it.


#MS_BATCHPLT_SPECS = $(MPM)Seed/Batchplt.spc Specific project batchploting setups
#MS_DWGDATA = $(MPM)Seed/dwgdata/ Specific project .dwg conversion setups
#MS_RFDIR > $(MPM)additional/ Additional project folders for reference files
#MS_RFDIR > $(MPM)additional/

Sounds fairly easy…
BUT beware! MicroStation may have a problem with between / and \. As a rule use the / and you should be ok.

Another tip worth noting is to place a carriage return at the end of all config .pcf and .ucf files. Make sure you have a carriage return after the last line or it does not read in the config file at all. Sometimes .pcf files have a hard time coping with #’s! If your .pcf doesn’t work then delete the hashed lines out.

Standards.cfg = The big Mama in configuration files!

What does it do?
Defines all your company configurations that make MicroStation as powerful as you wish it to be.

Where do I find it?
Workspace\Standards\

Make sure you go through each configuration you use and understand what it means. Try and put the definition in the file as well, so you don’t have to remember what they mean! Order your Standards.cfg logically so it easier to find your configuration, mine is set out under the following headings and then placed in a “sort of” alphabetical order (I’m not a nerd, just a geek!)

System (_USTN) Variables
MicroStation (MS) Variables
MicroStation Directories
MicroStation Files
Additional Settings
Project configuration variables

#----------------------------------------------------------------------
# Standards.cfg for V8
# Revision 1.0
# Date 13 January 2004
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# System (_USTN) Variables
#----------------------------------------------------------------------
_USTN_CAPABILITY > -CAPABILITY_LEVELS_CREATE
_USTN_PROJECTSROOT = $(_USTN_WORKSPACEROOT)projects/ _USTN_DISPLAYALLCFGVARS = 1
_USTN_USERNAME = $(USERNAME)
#----------------------------------------------------------------------
# MicroStation (MS) Variables
#----------------------------------------------------------------------
MS_PROTECTION_ENCRYPT = 0
%lock MS_PROTECTION_ENCRYPT
MS_DESIGN_HISTORY = create=0;delete=0;commit=0;browse=0
%lock MS_DESIGN_HISTORY
MS_HIDE_LIBRARY_SOURCE_NAMES = 1
MS_NEST_COLORADJUSTMENT = 1
# when set to 1, if an overall saturation or colour of a reference is adjusted it also affects any live nested references
MS_OPENV7 = 3
MS_OTWREG_NOCHECK = 1
MS_RASTER_LOADMODE = 2
# Sets RasterManager to load images into memory rather than a local temp folder from where it does not delete them!
MS_RENDERV7MATERIALS = 1
# Disables V8 functionality to resolve references that do not have a material table from the parent (ie where it is referenced into)
MS_SPELLINGLANGUAGE = BritishEnglish
MS_LEVEL_EDIT_ATTRIBUTE_LIST = OverrideSymbology,GlobalDisplay,GlobalFreeze,Lock,Plot
# what users can edit in Level Manager. Remember I put the opposite back into my .ucf so that, as CAD Manager I have more rights that the users.
MS_LEVEL_SYNC_ATTRIBUTE_LIST = Bylevelsymbology
# what updates when you sync levels from the dgnlib.
MS_REF_REATTACH_LEVEL_SYNC_ATTRIBUTE_LIST = Bylevelsymbology
# when reloading a ref the symbology overrides stay altered. We want the Bylevel symbology to change back to company standard.
MS_PLTFILE_EDITOR = HIDE_MENU_ITEM
# hide the menu item that allows the editing of drivers in the plot dialog box.
MS_V7TOV8_DELETE_UNUSED_LEVELS = 1
# Open to discussion this one. Apparently, when set to 0 it will only delete unused levels with "Required" set to 0 in a CSV file. If set to 1 it will delete all unused levels. Results may be varied!

#----------------------------------------------------------------------
# MicroStation Directories
#----------------------------------------------------------------------
MS_BUMP < $(_USTN_SITE)materials/bump/
MS_CELL = $(_USTN_SITE)cell/ # Cell libraries
MS_CELLLIST > $(_USTN_SITE)cell/*.cel
MS_CELLLIST < $(MPM)SEED/Projectv8.cel
MS_CELLLIST = $(_USTN_SITE)cell/*.cel
MS_CELLLIST > $(_USTN_SITE)cell/Ceiling/*.cel
MS_CELLLIST > $(_USTN_SITE)cell/furniture/*.cel
MS_CELLLIST > $(_USTN_SITE)cell/patterns/*.cel
MS_CELLLIST > $(_USTN_SITE)cell/people/*.cel
MS_CELLSELECTORDIR : $(_USTN_SITE)cell/ # Cell Selector files
MS_CELLOUT = $(_USTN_SITE)cell/ # Cell lib output dir
MS_DATA < $(_USTN_SITE)data/
MS_LIGHTING = $(_USTN_SYSTEMROOT)cell/
MS_MACRO < $(_USTN_SITE)macros/ # BASIC macros
MS_MATERIAL = $(_USTN_SITE)materials/
MS_PATTERN > $(_USTN_SITE)materials/pattern/
MS_PENTABLE = $(_USTN_SITE)tables/pen/
MS_SCR = c:/TEMP/
MS_SEEDFILES = $(_USTN_SITE)seed/
MS_SETTINGSDIR > $(_USTN_SITE)data/ # Settings Manager data
MS_TMP = c:/TEMP/
#----------------------------------------------------------------------
# MDL application are platform-dependent. Setting MS_MDLAPPS this way
# allows the same workspace tree to be shared by multiple platforms.
#----------------------------------------------------------------------
MS_MDLAPPS > $(_USTN_SITE)mdlapps/$(_PLATFORMNAME)/

#----------------------------------------------------------------------
# MicroStation Files
#----------------------------------------------------------------------
MS_BATCHPLT_SPECS = $(_USTN_SITE)data/ batchplt.spc
MS_CELL_SEEDFILE = $(_USTN_SITE)seed/seedv8.cel
MS_DESIGNSEED = seed.dgn
MS_DGNLIBLIST = $(_USTN_SITE)dgnlib/levels.dgnlib
MS_DGNLIBLIST > $(_USTN_SITE)dgnlib/Text & Dim.dgnlib
MS_DWGDATA = $(_USTN_SITE)tables/Dwg/dwgdata/
MS_DWGSEED = $(_USTN_SITE)seed/seed.dwg
%if exists ($(_USTN_HOMEPREFS)funckey.mnu)
MS_FKEYMNU = $(_USTN_HOMEPREFS)funckey.mnu
%endif
MS_PLOTDLG_DEF_PLTFILE = $(_USTN_SITE)plotdrv/Printer.plt
MS_SYMBRSRC > $(_USTN_SITE)symb/*.rsc
#MS_SETTINGS = $(_USTN_SITE)data/styles.stg
# I have hatched this setting out as MicroStation will not use Settings>Manage in the future.
MS_SHEETSEED = $(_USTN_SITE)seed/sheets.dgn
MS_TRANSEED = $(_USTN_SITE)seed/seed.dgn
MS_VBASEARCHDIRECTORIES = $(_USTN_SITE)vba/
MS_VBASEARCHDIRECTORIES > $(_USTN_SYSTEMROOT)vba/
MS_VBASEARCHDIRECTORIES > $(_USTN_SYSTEMROOT)vba/examples/
MS_VBANEWPROJECTDIRECTORY = $(_USTN_SITE)vba
MS_VBAAUTOLOADPROJECTS = cloudtool
%lock MS_VBAAUTOLOADPROJECTS
MS_V7TOV8_CSVNAME = $(_USTN_SITE)dgnlib/upgrade_remap.csv
# This is a remap file that I will use when upgrading projects from V7 to V8.

#----------------------------------------------------------------------
# Additional Settings
#----------------------------------------------------------------------
DESKTOP = $(USERPROFILE)/desktop/
MS_DGNAPPS $(_USTN_SITE)mdlapps/intelnt/synchbylevel.ma

#----------------------------------------------------------------------
# project configuration variables
#----------------------------------------------------------------------
MS_BATCHPLT_JOBSET_DIR = $(MPM)plot/
MS_CELL < $(MPM)seed/
MS_CELLLIST < $(MPM)seed/*.cel
MS_DEF = $(MPM)
MS_DWGFONTPATH = $(MPM)export/
MS_MATERIAL > $(MPM)3d/
MS_PATTERN > $(MPM)3d/
MS_PLTFILES = $(MPM)export/
MS_RFDIR > $(MPM)3d/
MS_RFDIR > $(MPM)plans/
MS_RFDIR > $(MPM)plot/
MS_SEEDFILES < $(0_SEED)
MS_SYMBRSRC < $(MPM)seed/*.rsc
MS_DGNOUT = $(MPM)export/
MS_IMAGEOUT = $(MPM)export/
MS_IMAGE = $(MPM)import/
MS_IMGOUT = $(MPM)export/
MS_TAGOUTPUT = $(MPM)export/
MS_TAGREPORTS = $(MPM)export/
MS_TAGTEMPLATES = $(MPM)export/
PZIP_OUT = $(MPM)export/

Phew, that contains just about everything!

But, what do the symbols mean?
= means set the variable to be this value.
> means add another value at the end of my list (or if not yet defined, does the same as =).
< means add another value at the start of my list (or if not yet defined, does the same as =).
: means set the variable only if it hasn’t already been set.
# means ignore anything after the # on this line.

So how does MicroStation put all these configuration variables together?
Ok, when MicroStation starts up it process from the lowest priority to the highest:

1. All the System variables …config/system

(there can be multiple config variables to process)

2. All the Application variables …config/appl

(there can be multiple config variables to process)

3. All the Site level variables …Workspace/Standards/ e.g standards.cfg

(there can be multiple config variables to process)

4. All the Project level variables …Workspace/Projects e.g. .pcf

(can process only one .pcf)

5. All the User level variables …Workspace/Users e.g. .ucf

(can process only one .ucf) The user level configuration variables take precedence over all the other level settings.

Crikey Dick, can I go now?
If you need to know more about what configuration variables you can use, go to the MicroStation Help files – search for “Working with configuration variables”.

Last word! It’s a worthwhile exercise to go through all your config files with a fine tooth comb! Once you have them clean and tidy it’s a lot easier to get to the root of problems, add in new configs and clean out superseded ones. Good Luck!