MicroStation CONNECT Edition Help

Example Expressions

The following examples demonstrate how to customize various print definition and output file name expressions. In the following expressions, the print set name is "plans.pset," the print definition name is "AR1," the sheet model name is "ANSI D," the printer driver configuration file is "pdf.pltcfg," and the date is "February 18, 2014."

Example 1: The Default Output File Name Expression

Expression Result
System.String.Format (“{0:D3}”, PrintDefinition.SetPrintDefNumber) & “-” & PrintSet.Name 001–plans.pdf

Example 2: An Output File Name Expression with a 2–Digit Print Counter

Expression Result
System.String.Format (“{0:D2}”, PrintDefinition.SetPrintDefNumber) & “-” & PrintSet.Name 01–plans.pdf

Example 3: An Output File Name Expression with a Date (yyyyMMdd)

Expression Result
System.String.Format ("{0:yyyyMMdd}", System.DateTime.Now()) & "-" & System.Path.GetFileNameWithoutExtension (PrintDefinition.SourceFile) 20140218–AR1.pdf

Example 4: An Output File Name Expression with a Date (yyyyMMMMdd)

Expression Result
System.String.Format ("{0:yyyyMMMMdd}", System.DateTime.Now()) & "-" & System.Path.GetFileNameWithoutExtension (PrintDefinition.SourceFile) 2014February18–AR1.pdf

Example 5: An Output File Name Expression with a Date (ddMMyyyy)

Expression Result
System.String.Format ("{0:ddMMyyyy}", System.DateTime.Now()) & "-" & System.Path.GetFileNameWithoutExtension (PrintDefinition.SourceFile) 18022014–AR1.pdf

Example 6: A Print Definition Name Expression with a 3–Digit, Zero-Based Print Counter

Expression Result
System.String.Format ("{0:D3}", PrintDefinition.SetPrintDefNumber -1) & "-" & System.Path.GetFileNameWithoutExtension (PrintDefinition.SourceFile) 000–AR1

Example 7: Use the Print Definition Name as the Output File Name

Expression Result
PrintDefinition.Name AR1.pdf