The topic of project configuration occurs regularly on the Bentley Discussion Groups. When asked by someone unfamiliar with MicroStation configuration, a question takes the form
Q "Does anyone know of any applications that will change all the reference file paths of a drawing automatically? I need to change all of the file names as well as the files that are refenced to those files to reflect the new project number?"
A The solution has been part of MicroStation since it was first introduced in 1987: configuration variables (henceforth abbreviated to CfgVars).
CfgVars are analogous to your operating system's environment variables. They let you create an alias of some value, such as a file or folder location. What's more, one CfgVar can be defined in terms of another CfgVar.
Here's a simple example.
Suppose all your projects are on a network server named server1 in a top-level folder called, for want of something more imaginative, Projects.
You can define a CfgVar that points to your projects folder like this …
PROJECTS = //server1/projects
In case you were wondering, you should always use the forward slash (/) as the folder separator in MicroStation configuration files.
Here is an example folder structure, showing a root folder Projects Folder for projects and two similar projects, Project 1 and Project 2. Each project has a DGN and references sub-folder. There's a sub-folder of the projects root for Common Files. Those might be, for example, your drawing borders, a set of site plans, or maps or charts.
The CfgVars for each project are defined in files Project1.pcf and Project2.pcf.
Note that the only change is to PROJ_NAME, which defines the /dgn and /references folders.
PROJECTS = //server1/projects/# All projects start herePROJ_NAME = Project1# This project's name# Where Project1 keeps its DGN files MS_DEF = $(PROJECTS)$(PROJ_NAME)/dgn/ # Where Project1 looks for reference files MS_RFDIR = $(PROJECTS)$(PROJ_NAME)/references/# References specific to this projectMS_RFDIR > $(PROJECTS)borders/# References common to all projects
PROJECTS = //server1/projects/# All projects start herePROJ_NAME = Project2# This project's name# Where Project2 keeps its DGN files MS_DEF = $(PROJECTS)$(PROJ_NAME)/dgn/ # Where Project2 looks for reference files MS_RFDIR = $(PROJECTS)$(PROJ_NAME)/references/# References specific to this projectMS_RFDIR > $(PROJECTS)borders/# References common to all projects
A refinement would be to define PROJECTS as an operating system environment variable.
Then we could omit its definition in each configuration file.
If your IT department decides to reallocate all your drawings to a new server or new root folder,
then you need change only the single PROJECTS variable to relocate all your project configurations.
You can start MicroStation using a command-line switch to specify a project configuration file.
You need provide only the name of the file, because (i) MicroStation looks in its Workspace sub-folders to find configuration files
and (ii) MicroStation knows the file extension of a project configuration file.
To start MicroStation and specify the Project1.pcf configuration, use this Windows command …
ustation.exe -wpProject1
You can start MicroStation and specify both the Project1.pcf configuration and a DGN file to open like this …
ustation.exe -wpProject1 file.dgn
CfgVars are well covered in the MicroStation documentation, but sometimes are hard to find. Depending on the version of MicroStation, the documentation makes it easy or hard to find the chapter about configuration. Look for a section named Administration or similar, or use the search tool to look for configuration variable.
Here are some links to tools for Administrators …
Here are some links to get you started …