Controlling pen wdths with pen tables


AskInga logo

Original Article Date: June 3, 2004

Ever wondered if you can control pen widths by using a pen table? If so, then follow along as Kevin Snook guides you through the process in this short one pager!

MicroStation 2004 Edition now offers a wealth of possibilities when it comes to plotting in the form of enhanced pen table functions. Pen tables among other things let the user selectively alter the printed appearance of elements, determine the order in which elements are printed, and control text string substitutions. There are a large number of output actions that can be controlled through pen tables, but the aspect I want to focus on in this article is how to control weight assignments given to elements at print time through the manipulation of pen width settings in pen tables.



Default Plot Driver without a Pen Table Attached
Open the delivered sample drawing ..\Workspace\Projects\Examples\Civil\dgn\CB2.DGN and select File > Print or just enter CTRL+P on the keyboard.

In the resulting print dialog, select your normal plot driver and make any other adjustments with respect to scale and paper sizes. Taking a look at the plot preview will show that the individual pen widths are taken directly from the printer.plt plot driver without any modifications.

While this may be the exact output that you want, more than likely, as in my experience the weights need to be adjusted in the plot driver to really make it look the way you intended. In the Pre-MicroStation 2004 era you would have had to hunt down the CADD manager, ask him/her to modify the weights for you, or you would have had to do it yourself "if you are fortunate enough to have write access to the files". Despair no more! You can now change the linewidth output with pen tables!

Assigning Output Pen Widths Through A Pen Table
In this little exercise you will create a new pentable, and populate a line weight mapping table from the contents of another plot driver file. Too cool!

From the Print dialog select PenTable > New

The Create Pen Table File dialog box opens and will be set to the folder defined by the configuration variable MS_PENTABLE. By default, this location is ...\Workspace\system\tables\pen\ which is a folder that is overwritten when you reinstall MicroStation. It is therefore strongly advised to use the ...\Workspace\standards\tables\pen\ folder for any custom pentables.

In the Files field, enter the name heavy for your pentable. You don't need to enter the extension, MicroStation will automatically give it a tbl extension.

Click OK


The Modify Pen Table dialog box opens. The new pen table is loaded and pen table processing is activated. When you create a pen table, MicroStation automatically inserts a single section called NEW. This section provides the minimum structure required in the pen table.

From the Edit menu choose Insert a New Section Above and name it Weights.

Now poke on the Map Weights button in the lower left section of the dialog. The Map Design Weights to Output Width dialog opens with a set of empty records.

From this dialog, select Edit > Import from Printer Driver and select the delivered tiff.plt plot driver from the ...\Workspace\System\plotdrv\ folder. Note that the dialog has been populated with the weight records as defined in the tiff.plt plot driver.

Click OK

Save the changes to the pen table by selecting File > Save from the Modify Pen Table dialog.

Dismiss the dialog.

Back in MicroStation, go to the Print dialog and select Preview. The resulting output will appear as shown in the image below. Presto, chango, lineweight modifications on the fly!

It’s worth noting that pen tables are ASCII files and contain plain text. You can edit them with any text editor such as Windows Notepad, or something more robust, such as UltraEdit. If you use Windows Notepad, be warned that it changes all file extensions to txt even when you want it to be something different such as tbl or plt. By opening up your heavy.tbl with a text editor, you'll see something similar to the image below.

By playing around a little in the Map Design Weights to Output Width dialog you will notice that by double clicking on the individual pen width records you can modify the width map for each pen to turn it on or off or set the width of each pen individually.

Under the File menu in the Pen Table dialog you can even import AutoCad plot style tables but thats another article all together. Ooh the possibilities, one plot driver with multiple pen tables perhaps? Happy printing!

AskInga Article #206