Referencing other configuration variables


AskInga logo

Original Article Date: March 29, 2004

When defining your configuration variables, you can easily refer to other pre-defined variables by using a particular syntax. Using this method can eliminate the need for creating new and possibly redundant variables and can also streamline how MicroStation resolves variables.

When defining your configuration variables, you can easily refer to other pre-defined variables by using a particular syntax. Using this method can eliminate the need for creating new and possibly redundant variables and can also streamline how MicroStatio resolves variables.

When developing your workspace you can refer to other variables by using a specific syntax.

Very simply, to set a variable by referencing another variable only upon request by MicoStation use: $(variable_name)
And to hard code a variable by referencing another variable, use: ${variable_name}.

Let's take a closer look by examining the delivered Examples workspace in conjunction with the Architechtural project. When using this workspace MicroStation automatically points to a specific folder when opening design files.

By opening and examining the ...\Workspace\Projects\Examples\architechtural.pcf file, we can see the following line of code:

MS_DEF < $(_USTN_PROJECTDATA)dgn/ which means that MS_DEF is looking at the dgn sub-folder of the one defined by _USTN_PROJECTDATA.

(In fact, you'll notice that all project-related data is pointing to specific sub-folders of _USTN_PROJECTDATA.)

Understanding the [[What happens when you launch MicroStation?|order of processing]] and with the assistance of a [[Viewing and Determining the Configuration Variables |debug report]] we can trace _USTN_PROJECTDATA back to the sub-folders located in ...\Workspace\Projects\Examples\Architectural\.

As you can see, using the $(variable_name) referral system allows you to easily build upon existing variables defined elsewhere in the configuration heirarchy. But that's not all.....

In addition to the $(variable_name) syntax, you can also employ the use of other directives to contruct new variables. These directives give you the ability to use selected bits and pieces of existing variables to build new ones as shown in the table found in the Workspace Variable Directives Technote.

AskInga Article #201