Product(s): | MicroStation | ||
Version(s): | 10.17.02.61 | ||
Environment: | N\A | ||
Area: | Properties | ||
Subarea: | Named Expressions |
Pen Table Text Substitution with Named Expression
From User…
Requirement is to use a pen table to substitute a text $SITE_ADDRESS$ and replace it with project configuration variable value SITE_ADDRESS. Use a Named Expression to change the value of SITE_ADDRESS to Upper Case.
Refer to this Blog for details on how Named Expressions can be used in Pen Table text substitution.
Create a configuration variable SITE_ADDRESS and set a required value.
SITE_ADDRESS = Mother Care Building, Alkurnaish, Al Khobar 34427
Create a DGNLIB file “MyNamedExpression.dgnlib” and create the following named expression.
_SiteAddressUpper = system.string.toupper(ConfigVar.GetExpandedConfigVar("SITE_ADDRESS"))
Add the named expression DGNLIB file name to configuration variable MS_GUIDGNLIBLIST. Refer Wiki
MS_GUIDGNLIBLIST = MyNamedExpression.dgnlib
Create a Pen Table “my_pen_script.tbl” and add the following Text Substitution variables.
$SITE_ADDRESS$ = <expr?name=_SiteAddressUpper>
Create a DGN file with following Texts.
Site Address : $SITE_ADDRESS$
Start the Print tool and attach pen table “my_pen_script.tbl” to get the following output.
Test Files
communities.bentley.com/.../MyNamedExpression.dgnlib communities.bentley.com/.../TestExpression.dgn communities.bentley.com/.../my_5F00_pen_5F00_script.tbl
Named Expressions in Conjunction with a Pen Table
Original Author: | Leonard Jones |