| Product: | MicroStation | |
| Version: | 08.11.09.459 | |
| Environment: | N\A | |
| Area: | Configuration | |
| Subarea: | DGN Settings | |
Background
The configuration variable MS_DEFCTBL allows to specify a certain color table for new files and files, which do not have color table attached. But what about existing files, which have different color tables attached? There is a KeyIn CT=<name_of_color_table>.tbl which can be executed in a DGN. But I want to do this automatically when opening any file.
Steps to Accomplish
- First you need a BASIC macro like this:
Sub Main
MbeSendKeyin "ct=<drive>:\<path>\<my_color_table>.tbl "
End Sub
Create it with a simple text Editor like NotePad (notepad.exe) and save it with the file extension BAS, for example colortable.bas. It should be stored in a folder to which the configuration variable MS_MACRO is pointing. Normally it should be ..\WorkSpace\standards\macros\. After the first time executing the BAS file a compiled BA file will be created. BASIC files can be executed in the pulldown menu Utilities > Macro > MicroStation BASIC. Then Browse it in the dialog and in the Start Macro dialog Run it. Remember, this will already attach a color table to your DGN. So do it in an empty file.
- The configuration variable MS_DGNAPPS must contain the value runmacro.
- The configuration variable MS_DGNMACROS must contain the name of the compiled BASIC macro (eg. colortable.BA). If the variable does not exist create it first.
Now every time a DGN is opened it will get this certain color table attached. And this ensures, that edited color tables are corrected when opening a file next time. This does not work for DWG files, because they have a fixed color table.
See also
Other language sources

| Original Author: | Sven Zigelski | |