Inserting the value of a variable into the pdf filename using Named Expression


 Product:MicroStation
 Version:V8i, CONNECT
 Environment:N\A
 Area:Printing
 Subarea:Driver/PDF

Problem:

A MVBA is searching for a certain Tag in the design file. The value (in this case 05) of this Tag is saved in the variable PLOT_INDEX. The value of the variable should replace the placeholder ## of the sheet model name when creating a pdf file.
 
Variable Plot_Index with value 05

 
Name of the model with placeholder ##
 

Solution:

The following named expression can be used to get the desired result.
 
System.String.Substring (PrintDefinition.MasterModelName, 0, 11) &
ConfigVar.GetExpandedConfigVar ("PLOT_INDEX") & System.String.Substring
(PrintDefinition.MasterModelName, 13, -1)
Insert the name of the named expression PLOT_INDEX in the pdf printer driver configuration file.

 
The PDf file name result looks like this. The placeholder ## was replaced by the value of the variable PLOT_INDEX
This named expression only works in the context of the print dialog box
You will find a detailed description - How to create a named expression - here
VBA to extract the Tag value and update Configuration variable "PLOT_INDEX" value.

communities.bentley.com/.../TagValueToConfVar.mvba

See also

Other language sources

 Original Author:Frank Reimann