Original Article Date: March 24, 2004
Last revised: May 13, 2011
Nearly everything you ever wanted to know about the User Preference File...what it is, where it is, and configuration variables to help monitor it's condition.
2006-07-05 Updated to include the variable for always creating a new UPF at startup.
2008-03-31 Updated for MicroStation V8 XM Edition
What is it?
The User Preference File, or simply the UPF file is a binary file that contains information such as the settings located in Workspace > Preferences, your Button Assignments, the location of opened tool boxes, the keyin history and others. In addition to MicroStation, some MDL applications may also use the UPF file to store specific settings and preferences.
Where is it?
In a default installation of MicroStation v8 2004 Edition, the UPF file is located in the ...\Program Files\Bentley\Home\prefs\ and will have the same name as your workspace. So, if you've been working in the delivered workspace called Examples there will be a corresponding examples.upf file in the Home folder.
In a default installation of MicroStation V8 XM Edition, the UPF file is now created dynamically when MicroStation starts and can be located in the folder defined by this system variable: CSIDL_LOCAL_APPDATA\Bentley\MicroStation\8.9\ . In normal setups, this will expand to: C:\Documents and Settings\*user name*\Local Settings\Application Data\Bentley\MicroStation\8.9\
Why are my UPF files different sizes?
UPF files are dynamic and are being written to while you are working in MicroStation. As your preferences and settings change, so does the size of the UPF file. Additionally, preferences and settings may vary from workspace to workspace which would account for the difference in UPF file sizes.
My tool boxes aren't where I left them, my views won't tile and there's other weird stuff going on.
What's up with that?
As mentioned above, your UPF file is dynamic and will grow in size as your preferences change. So in some instances when the UPF file becomes too big it may become unstable or even corrupt.
What happens when I run more than one instance of MicroStation?
Since the UPF file is dynamic, it will be receiving information from each instance of MicroStation that you've got running thus increasing the potential risk of corrupting the UPF file. When you run more than one copy of MicroStation it is strongly advised to use different workspaces. This can be as simple as creating a couple of workspaces called session1 and session2.
Can I somehow monitor UPF file?
Yes, in MicroStation V8.5 - 2004 Edition you can set this configuration variable: MS_MONITOR_USER_PREFS = 1. This variable causes several tests to be activated, including watching for MDL applications that may use the UPF file improperly.
Can I compress a UPF file it it's too big?
Yep, if you're running MicroStation V8.5 - 2004 Edition or later, you can set MS_COMPRESS_USER_PREFS = 1. This new configuration variable will cause MicroStation to detect UPF files that are larger than 500K and compress them.
With thanks to Barry Bentley for sharing these two variables on the Bentley discussion groups
So, how do I repair a corrupted UPF file?
You don't. Instead, you simply delete the UPF file for the workspace that you're having problems with. Then when MicroStation is re-started, it will automatically build you a new UPF file which will require you go reset your Workspace > Preferences.
But...I don't remember all my settings!!!
Well, I can't help you with that, but can offer a nifty solution so that you won't have to adjust your workspace preferences in the future. Here's how:
Set up your preferences the way you like them. Copy that UPF file to a different location and, if you want, rename it too. Finally, point the variable MS_USERPREFSEED to this new file. The next time you delete your UPF, MicroStation will create a new one based on the seed file above.
What if I want a new UPF every time I start MicroStation?
No problem, use this handy dandy variable shared by Miroslav Mataš on the discussion groups: MS_ALWAYS_CREATE_UPF = 1 Note that it will use MS_USERPREFSEED if it's been defined.
Special Note: Bentley's Phil Chouinard writes: UPFs often get blamed for a lot of things and that blame is often misdirected. How? Well... there's a very big difference between cause and effect. Alleviating the effect by deleting the UPF does little, if anything, to remedy the cause of the problem which could be something much deeper and many times more serious. The cause could come from any number of sources, which is why it is so important to find out what led up to it. It is well worth every minute of investigation -- and often makes things work much better all around. more >>
Other references:
AskInga Article #193