Advanced Project Explorer - Configuration Variable Links

                    When you are working on a project, you work with many files, designs and models. Have you ever been irked when you have to flip through many of these files to get to the right model, and correct view? I bet you have experienced this!

Agreed, Project Explorer can become a central resource to organize your data, but wouldn't be useful to have something simple that helps you do some organization?

If your answer is "Yes", the configuration variable link may be of use to you. 

                    Traditionally, configuration variable in Microstation is used to provide list of directories or files that serve a specific purpose. For example, MS_DEF is used in MicroStation to represent a set of locations where your design files may exist. Succinctly, a configuration variable may point to files/folders, where you store your designs. A configuration variable link is designed to take advantage of this fact. Using a configuration variable you can browse these files/folders together. Or better still, you can dig into these folders to find out certain information within the files, such as, models, sections or views.

You can do all this and more using Configuration Variable Link.


So without any further ado let's start off learning Configuration Variable Link related concepts. As soon as you press on it this dialog box pops up.

Project Explorer -> Create Link -> Configuration Variable Link

First text box is simply the name of the link you want to create. The second drop-down combo-box, named "Variable", basically consists of the configuration variable and filter.


                    Lets select a particular set which is the third one from top, "Sheets {Model: Design} $(MS_DEF)". Let's understand this format from right to left. The Last bracketed part( $(MS_DEF) ) is the configuration variable which holds the path of the file or files or in different scenarios it can hold a completely different values, may be only file name or some numerical value or anything else. And these variables are either Microstation specific or defined by ourselves. So you have specified the path of the files where you want to make links from.
Any configuration variable that identifies files or directories can be used to define a harvested folder. If the configuration variable identifies a directory, then all files in the directory and its subdirectories are searched. The configuration variable can also identify a single file or a regular expression.

                    Now suppose you are leading a project and there are plenty of guys working of that project and you have strictly specified that each file should have a maximum of n no. of views and you want to be looking at the views to know how much progress have happened. In that case you can have resource filter which will make links to only the views from the models. This is what the second curly-bracketed part does. It's a resource filter which makes sure that links are made only to those things which you are interested in.

                    The configuration variable identifies the set of files to be searched. The resource filter identifies the type of resources to find within those files. A resource filter consists of the resource type, followed by an optional subtype. The types and subtypes which you have in Micro station are listed below.


And the texts which are left to this filter are basically the default name of the links. They will be used as the link set name if the Name is not specified in the Name textbox.

                    As you can see that the last item in the combo-box is the "Custom (User Defined)", is intended to enable us to make links with custom filters and custom configuration variables. As soon as you select this item, the last text box, named "Variable Name", gets activated in which you can write your custom filter name and variable path.

                    Format for custom variable name is more or less similar to the one which are defined in the combo-box. You can not assign the default name at the start in this case. So the format will consist of only filter and the configuration variable name. In this case you have assigned it "{Model: Sheet} $(MS_DEF)" where first bracketed part is the filter and second bracketed part in the configuration variable name. "$" Dollar is compulsory before the configuration variable bracket. So in my case it will get all the Sheets from the models which are at MS_DEF path and makes the link to all those Sheets. You can have multiple configuration variables separated by semi-colon like $(MS_DEF)*.dgn ;$( MS_DEF)*.doc: Where MS_DEF configuration variable is the folder path, in this case it shall get all the .dgn and .doc files from there and will make the link depending on the filter. But you can have only one filter for a link.



You can change the properties of the link from the properties window. In project explorer You can right click on the link and select the Property menu item and foreshown dialog box comes up in which you can change the filter and configuration variable.

You can also add expressions to the configuration variables. These expressions further harvest the folders on the basis of file path, file type, or file name. For example:

  1. $(MS_DEF)Project - All files are harvested within the \Project directory and subfolders recursively.
  2. $(MS_DEF)*.dgn - This is a wild card match, all entries (folders or files) matching *.dgn inside $(MS_DEF) will be searched. In general, *.dgn will match files and it would appear that the expression $(MS_DEF)*.dgn
    is non-recursive. But we can have a folder that matches *.dgn (such as all.dgn\). In this case, the expression $(MS_DEF)*.dgn will search in the all subfolders in the folder all.dgn\
  3. $(MS_DEF)*.dgn\ - This is just same as above except the addition of directory seprarator "\" or "/" makes the search only for folders maching *.dgn\
  4. $(MS_DEF)Test.dgn - Test.dgn is harvested within the MS_DEF.

                    You can add multiple configuration variable expression by separating them with a semicolon. For example, $(MS_DEF) Project\*.dgn ;$( MS_RFDIR)*.dwg, which means harvest from all the DGN files at $(MS_DEF) Project\ and all the DWG files at $(MS_RFDIR)\.

There should be no blank space character between multiple expressions.

                    I hope this page will go a long way in helping you understand the usability of configuration variables. More practice and using different permutation and combinations will make aforementioned concepts clearer and helpful. Let's give it a pause until I come up with new topic to discuss with you. Till then Happy Reading!

  • Mark, I have learned alot from your posts and thought I would bounce this off of you. I know this is an old thread but I wanted to start somewhere...

    I am experimenting on my lunch hour on adding a filepath to a sheet model next to the border but no resolve the path on the screen as to protect that information from outside sources, such as a client. But if i print the file, then the link would work internally.

    So here is the questions....

    Can I add a link to a piece of text that will navigate to the active file that I have open in ProjectWise? I know the keyin statement to navigate and open the file in the working directory but it is only navigating to the local dms folder and not into ProjectWise. I figured it must be how to get it to resolve the path in the key-in for DGNFILE to reflect the PW path but then use that as either a keyin to send a url to prompt ProjectWise to navigate to the file or a link to the element.


  • Stuartw, I modified this blog to expain the things more clearly. In general, we do the searches recursively. Although we realize that if you want to search for a particular resource type (e.g. design models) in only the dgn files (not in dwg files for example) recursively in a folder,  it's not possible to write such expressions. We are taking this into consideration.

  • Thanks for this. You say:

    >A configuration variable expression harvests files from the specified folder only and not from the subfolders within the folder.

    Is there a way of getting this to search sub-folders as well?