CAD Managers often have use for “automatically” setting global commands for their MicroStation users. The use of .cfg files in conjunction with a simple Basic Macro can yield positive benefits. In a real case scenario color tables were being attached from various locations and outside of the CAD Standards defined for the organization. It was determined to automatically attach a single color table to each design file on Open along with automatically setting other commands not defined by Configuration variables. Case: Corporate workspace with the MicroStation \\APPL folder located on the server
1) Create a simple Configuration file called COMMANDS.cfg with the following syntax: MS_DGNMACROS > $(_USTN_SITE)macros/commands
2) Locate this file commands.cfg within the MicroStation \\APPL folder Note: In a corporate workspace this folder should be located on your server. The variable _USTN_SITE as listed above is the standard pointer location fo the \\Standards\ folder
3) Develop a simple Basic Macro called COMMANDS.bas with the following syntax: Sub main MbeSendCommand "Attach Colortable \\Servername\bentley\workspace\standards\data\company.tbl" MbeSendCommand "SET SHARECELL OFF " MbeSendCommand "set hilite yellow" MbeSendCommand "set xor white" End Sub 4) Locate the file COMMANDS.bas within the MicroStation macros folder
Note: In a corporate workspace this folder should also be located on your server (example: \\servername\bentley\workspace\standards\macros) Any sequence of commands can be run in this manner as seen in the basic macro syntax
5) If there is no corporate workspace in place at your organization a simple email and download of these 2 files to the local system folders will produce the same results. The only change necessary would be the folder location pointers as defined in the COMMANDS.cfg and COMMANDS.bas file.
6) In the case of a Corporate Workspace scenario, one can simply rename the COMMANDS.cfg file to COMMANDS.cfg.xxx to temporarily “turn off” all of the automation without having to edit the basic macro file. MicroStation will only read and execute .cfg files located in the \\APPL folder
If you wish to subscribe to our monthly Knowledge is Power Ezine, please send an email to: This email address is being protected from spambots. You need JavaScript enabled to view it.