How to include the filename extension in the plot file name

By default, when creating plot files using a MicroStation printer driver configuration file, only the name of the file is included when the plot file is generated.  There may be a situation where you would like to include the filename extension as well.

To accomplish this, the printer driver configuration file must be edited to change the default value of the “File Name” entry in the “Default Print File Name” category under the “Base Properties” tab.  For example, in the pdf.pltcfg printer driver configuration file, the original value is of this field is:

$(MS_PLTFILES)$(basename(_DGNFILE))-$(MS_PLTMODELNAME)-<autoInc?digits=3?base=0>

This creates a print file in the MS_PLTFILES directory, whose file name consists of the open DGN file's name, followed by a dash, followed by the open model's name, followed by a dash, followed by an automatically increasing number starting with 000, with a .pdf extension.

To accomplish this, the “File Name” value must be edited as follows:

$(MS_PLTFILES)$(filename(_DGNFILE))-$(MS_PLTMODELNAME)-<autoInc?digits=3?base=0>

Notice that the only change is to modify the keyword “basename” and exchange it with the string “filename”.  This will allow all plot files generated with the printer driver configuration file to now contain the filename extension in the plot file name produced by the printer driver configuration file:

Notice in the example below, the first plot file is produced from the default “File Name” syntax as delivered with the PDF printer driver configuration file.  The second plot was produced with the modified value for the “File Name” field which produces a plot that includes the extension of the design file name:

Additional options for modifying the printer driver configuration file is documented in MicroStation’s Help in the following location: Setting Up Projects>Workspaces>Workspace Configuration>Configuration Variable File Syntax>Variable Definition References>

A variable definition can contain references to other variables. References to other variables are made with the following syntax:

Reference

Meaning

$(VARIABLEREF)

Expand VARIABLEREF when this variable is used.

${VARIABLEREF}

Expand to current value of VARIABLEREF.

The product recognizes the following kinds of variable definition references:

Reference

Returns

dev()

device

dir()

directory

devdir()

device and directory

parentdir()

parent directory

parentdevdir()

device and parent directory

basename()

filename without extension

filename()

filename with extension

ext()

file extension

noext()

Complete file specification without extension

first()

first path from a list of paths

concat()

concatenated string

build()

constructs a definition from pieces of variables

For example, consider configuration variable MS_EXAMPLE_FILE with the definition "d:\Bentley\Workspace\MyProject\3dcells.cel".

  • $(dev (MS_EXAMPLE_FILE)) expands to "d:"
  • $(parentdir (MS_EXAMPLE_FILE)) expands to "\Bentley\Workspace"
  • $(filename (MS_EXAMPLE_FILE)) expands to "3dcells.cel"
Anonymous