MicroStation CONNECT Edition Help

Named Expressions in Conjunction with a Pen Table

Named expressions have many uses, and one of them is to extend the capabilities of basic pen table text substitution. The <expr?=name> token can be inserted into a pen table text substitution replacement string to reference a named expression. This offers a number of advantages over pen table predefined replacement tokens and environment variables. In a named expression, you can use any number of symbols (many of which are not available as environment variables), and take advantage of the formatting capabilities and even 'if else' conditional logic.

For example, suppose you want to print the author of a DGN file, not the current Windows user, as was shown in the previous section. The first step is to create the named expression in the DGN library. The "_Author" named expression shown below demonstrates the use of a property value (Author) that is not available from the pen table replacement tokens, printing accounting variables, or other environment variables.



Named Expression for the DGN file author

The second step is to use the Edit > Insert New menu item on the Text Substitutions dialog to insert a replacement pair. Then for the replacement pair, enter both the original string to be replaced and the desired replacement string.



Pen table referencing a named expression

When using the <expr?name=...> token, you must specify the Internal Name of the named expression. In the example shown above, notice that you are able to use the <expr?name=...> token in conjunction with environment variable references and literal text. The print preview output with the replaced string is shown below.



Preview using a pen table referencing a named expression

You can also use the <expr?name=...> token in the print border text string.