How do I add the file revison number to the output file name?

 Applies To 
 Environment: N/A
 Area: Printing
 Original Author:Ed Yepes, Bentley Technical Support Group








Problem Description

Using PDF.PLTCFG I would like to be able to include the revision number of the file in the output file name. As an example the file is named "File 1.dgn" I would like the output file name to read "File 1-Revision xx.PDF"

Steps to Resolve

You would need to create a Named Expression in order to retrieve the Revision Number from the MicroStation file.
To create the Named Expression in MicroStation open a .dgnlib file used in your project or create a new file. Make sure to add to your MicroStation MS_DGNLIBLIST variable if you are adding a new file.
Open Print Organizer
In the MicroStation pull down menus go to Utilities->Named Expressions
Click on the "New" icon
Enter an Internal and External Name (I would use the same name).  You will need to remember the "External Name"
Select Print Set Under "Keywords"
Under Symbol Sets, Add the following: Active File, System.Path, Print Definition, Print Set
Place the following under Expression
System.Path.GetFileNameWithoutExtension (PrintDefinition.SourceFile) & "-Revision " & ActiveFile.RevisionNumber
Save Expression
Close the GUI
Attached is an example of an expression I created called "FileName RevisionNumber"

Now we need to modify your Printer Driver Configuration file PDF.PLTCFG
Open Print Dialog box. Select File->Edit Printer Driver Configuration File
Select the Base Properties Tab
Expand "Default Print File Name"
In the "File Name" field enter $(MS_PLTFILE)<expr?name=FileName RevisionNumber>

Note: For those who cannot see anything after $(MS_PLTFILE) it should read:
<expr?name=FileName RevisionNumber>

Save and reload Printer Driver Configuration file.  Now every time user uses this .pltcfg he will get the revision of the design file in thePDF file name.

You can get more information on named expressions at the following Be page: