Note: The content in this article is for pre-V8 versions of MicroStation only.
Did you know that you can activate dialogs, tool boxes and tool frames just by using a keyin? Do you know how to get the resource ID number for a tool box? Need to close a dialog with a keyin? Or open a dialog with a keyin? If so, then read this contribution by Larry Whitt.
With thanks to Larry Whitt for the content of this article. Larry is a popular and valued member of the MicroStation community and you can always be sure to find his contributions on Bentley's newsgroups and CCM.With thanks to Bentley's Rudi Wells for spotting an error and setting us straight!You can toggle the display of any MicroStation dialog, toolbox, or tool frame with a keyin if you know its name and resource ID number. There are a couple of different ways to determine an items resource ID number. One method is to use the keyin dialogdebug as follows:
Another method of extracting the ID number of a tool box is to utilize the Attach Tool Box button when customizing a menu bar item. This time MicroStation will extract the ID number and build the keyin to toggle the display of the selected tool box. Again, note the value of the ID number as shown below.
And finally, there's ...\Program\MicroStation\mdl\include\dlogids.h that lists MicroStation's item ID numbers. Look for "TOOLBOXID_tool box name" and just to the right of it will be the ID number. Keep in mind though that many of these will not work as keyins since they require internal setup by MicroStation. (Thanks to Barry Bentley for this tip!)
Something of interest - The ID numbers for MicroStation dialog boxes, tool boxes, and tool palettes are for the most part negative. An exception to this is the AccuDraw DataPoint Keyin Window and the Plot Preview window which both have positive ID numbers. Also, custom tool box ID numbers are nearly always positive.So, here comes the good stuff! The table below shows the keyins to open all those dialogs, tool boxes and tool palettes.
To close dialogs, you're going to use one of the following keyins depending upon the ID number of the dialog.If the ID is negative: dmsg closedialog ID where ID is the number of the dialog.If the ID is positive: dmsg closedialog ID DialogNameFor example, to close the Plot Preview window, you would use: DMSG CLOSEDIALOG 1400 plotdlg. And for closing AccuDraw's datapoint keyin window, the command is: DMSG CLOSEDIALOG 2 accudrawTo wrap this up, care must be taken if you are tempted to experiment by opening dialogs by keying in random resource ID numbers...just to see if something will happen. Once displayed, some dialogs may not permit you to exit or close the dialog and may even lock up MicroStation. Others may cause MicroStation to exit and in rare cases, the UPF or the design file might become corrupted! This can happen if the dialog is meant to display an alert, a warning or something along that line. There are also some dialogs that are similar in appearance to an OPEN dialog, but when accessed via the key-in they may be non-functional. These could be templates that require an associated application to "populate" the dialog, or are "left-overs" from development - whatever. In any event, there can be unexpected results when randomly trying out resource ID numbers...so exercise caution.