Using MicroStation variables in Print border comments

Placing needful information in the border area of each of your plots can prove to be very useful.  The name of the design file and/or the current date/time your plots are submitted can be printed on each plot. 

For any of these options to work, the border must be “activated” (turned on).  This can be done in several ways.  It can be activated on a plot-by-plot basis, by simply checking the “Print Border” box under Settings>Print Attributes from the MicroStation Print menu (as illustrated below):

This setting, however, only remains active while the current print dialog box is displayed.  Once this dialog is dismissed, the value resets to “OFF”.  This is because the border entry (“Border On”) in each printer driver configuration file is set to “False” by default.

Another method that can be used to turn the border “ON” is to edit the printer driver configuration file itself.  As mentioned, when editing any given printer driver configuration file, the “Border On” option is set to False initially.  It can be turned ON by changing the value to True.  This value activates the border on a more permanent basis.  Each time the Print Menu is opened, provided the same printer driver configuration file is used, the “Print Border” print attribute will be set to ON automatically.  The border attribute will remain ON as long as that particular printer driver configuration file is being used.  When editing the printer driver configuration file, the “Border On” field is located under the “Base Properties” tab in the “Print Border” section of the file:

A third approach to turning on the border option would be to activate the border in a Print Style.  A Print Style is a function of the Print Organizer utility.  It allows for Print Attributes to be set from a DGN Library.  This method sets the attribute value each time MicroStation’s Print Menu is opened (provided the Print Style is designated as a “Default” Print Style) or it can be manually applied.

Refer to MicroStation’s Help utility for more information on Print Organizer’s Print Style capability:

Regardless to which method is used to turn the border “ON”, the printer driver configuration file will still need to be edited to allow the filename and date/time stamp to be printed in the border area of the plot.  The only exception, as we’ll see later, is that various MicroStation variables can be used to accomplish this feat.  Using variables will allow for more flexibility when it comes to the order in which the information can be printed in the border field.

When editing the printer driver configuration file, you will notice that, by default, the “Include File Name in Border Text” and “Include Date/Time in Border Text” is set to False.  When setting these values to True, the following format of the filename and date/time is printed in the bottom left corner of your plot:

filename.dgn 2/1/2012 8:38:59 AM

Notice that only the name of the design file is printed (not the full path to where the file is located).  The filename’s full path can be printed in the border field.  That will be discussed in more detail later.  Another thing to note in the above example, is that the default format for the date entry is mm/dd/yyyy.

Let’s say that instead of the default date format of mm/dd/yyyy, you needed the format to appear as “February 1, 2012”.   The MicroStation variable MS_PLOTBORDER_TIME_FORMAT can be used.  You would simply need to add the variable to your MicroStation workspace using the Workspace>Configuration command and set the appropriate value. 

The date format can be adjusted as follows to produce the output you desire using this variable.  For example, when adding the workspace variable MS_PLOTBORDER_TIME_FORMAT, give it the value of %A, %B %d, %Y.  This will produce a date output of “February 1, 2012”.

Detailed information about the use of this variable is available in MicroStation’s Help file:

Help>Contents>Working with Complete Designs>Printing>Printer Driver Configuration Files>Printer Border Properties>Date and time format:

Use the MS_PLOTBORDER_TIME_FORMAT configuration variable to adjust the format. There are also strftime( ) formatting codes. With these formatting strings, you can choose how to display the date and time. For example, you can set MS_PLOTBORDER_TIME_FORMAT=“It is now %I:%M %p on %A, %B %d, %Y”, which displays as “It is now 02:36 PM on Monday, December 10, 2007”.

The following table lists the variables and their definitions:

Variable

Definition

%a

Abbreviated weekday name

%A

Full weekday name.

%b

Abbreviated month name

%B

Full month name

%c

Date and time representation appropriate for locale

%d

Day of month as decimal number (01-31)

%H

Hour in 24-hour format (00-23)

%I

Hour in 12-hour format (01-12)

%j

Day of year as decimal number (001-366)

%m

Month as decimal number (01-12)

%M

Minute as decimal number (00-59)

%p

Current locale's A.M./P.M. indicator for 12-hour clock

%S

Second as decimal number (00-59)

%U

Week of year as decimal number, with Sunday as first day of week (00-51)

%w

Weekday as decimal number (0-6; Sunday is 0)

%W

Week of year as decimal number, with Monday as first day of week (00-51)

%x

Date representation for current locale

%X

Time representation for current locale

%y

Year without century, as decimal number (00-99)

%Y

Year with century, as decimal number

%z, %Z

Time-zone name or abbreviation; no characters if time zone is unknown

%%

Percent sign

The example below will produce printed plots with the following text string in the border field:      “It is now 10:05AM on Tuesday, February 1, 2012”.

Note: Using this method will require that “Include Date/Time in Border Text” is set to True.

Now, let’s say you would prefer to have the full path of the design file name printed instead of only listing the name of the file.   You might also rather the order of the border comments to display as date, time and then the full path name of the design file.  By default, the order of the information printed in the border area is: filename, date then time.  This default order cannot be altered.  In such a case, the following MicroStation variables can be used to accomplish the order in which you want the information printed. 

The MS_PLTDGNFILE_LONG (or {_DGNFILE}) variable can be used to print the full path name of the design file.  We could then use the MS_PLTTIME and MS_PLTDATE variables to print the current date and time of the plot.  This allows for the information to be printed in any order you desire.  These variables can be used without setting a value to them.  They do not have to be added to your MicroStation workspace using the Workspace>Configuration option as is required by other variables. 

These variables can be applied directly to the “Border comment” field from the Print Attributes box under the “Settings” option in the main MicroStation Print Menu as shown below:

They could also be specified in the “Border Comment” field of the printer driver configuration file:

The above example would produce the following border comment output on each plot:

c:\temp\filename.dgn   2/1/2012   8:38:59 AM

As mentioned earlier, if the desire is to print the order of the border comments as date, time and then the full path name of the design file, you would simply place the variables in that order:

$MS_PLTDATE  $MS_PLTTIME  $MS_PLTDGNFILE_LONG

Note: When using these MicroStation variables in this manner, the options “Include File Name in Border Text” and “Include Date/Time in Border Text” should be set to False in the appropriate printer driver configuration file.

Anonymous