HOW TO MAKE ICON BAR FILES
| (For a Word
6-format version of this How-to,
click here to download) |
INTRODUCTION
DataCAD v.6 introduced user definable icon bars. V.7 extended the icon files to allow 3 different sizes of buttons. Knowing what you know about keyboard macros makes the explanation of icon bars much easier, because it works on the same principle. But now you can use graphic icons across the top of your DCad screen to invoke whatever DCAD commands or macros that you would like.
Our office uses two primary menu bars; one for 2D and one for 3D work. We only make one icon bar for each because we feel that too much clicking through multiple menu bars defeats the purpose of having the menu bars in the first place. One exception to this rule might be to have a third (or more) icon bar to go to certain standard office defaults -- for instance, you might make an icon bar with options for standard TEXT and DIMENSION settings. Each icon button could be set for TEXT or DIMENSIONS at scales of 1/8", 1/4", 1/2", 1", etc. Each one would be set up to make your entities of the correct size, color, orientation, and all other optional settings.
The size you will want to use for your icons will depend on what resolution you are viewing DataCAD at, what size your monitor is, and of course by personal preference. The smaller the icons the more you can fit in one screen, but the harder they are to see, too. If you have more icons than will fit at the top of one screen, scroll arrows will appear to allow you to access the icons off the screen. The icon sizes are measured in pixels the standard icons are 24x24. The maximum allowed is 100 per icon bar in DataCAD version 10, or 50 per icon bar in earlier versions.
The best way to make a small fortune is to start with a large one, and likewise, the best way to make a new .KEY file is to start with an existing one. I started with the custom .KEY file and icons from the "Productivity Pack" from Madura Studios, and from the Cheap Tricks Ware "Icon Bar Collection" by Rick Ferrara. I then substituted some of the icons from those files with some others that I liked better, and created some new ones using Paint Shop Pro (more on this later).
I will use our 2D icon bar as an example. Unlike the keyboard macro files, you can name your icon bar files anything you want, as long as it ends with the file extension of KEY. However, the format for the KEY file is very exact, and you can not deviate from it by even one space or it will not work. All of the "pipes" ( | ) are important and must align, which is a good way to verify that your spacings are correct. Don’t forget the last pipe at the end of the Message column (my pipes don’t line up here only because of the font I am using).
Each .KEY file is a total of 185 columns long. The following information is from the DataCAD Reference Manual (v. 9), pg. 609, with a few additional comments, and refers to the KEY file shown further down on this page.
| Column | Name | Function |
| 1 | Action Code | Contains an Action Code that identifies the function or program to access. It tells DCad what to expect to see in the "Action" column. Both of these columns must agree with one another or the icon will not work. See the list of "Known Symbols and Commands" for what can go in here. |
| 3 - 4 | Not currently used -- leave this blank. | |
| 6 - 13 | Menu Level String | Contains up to an 8 character description for the Message Window. Any characters are valid and you can enter whatever you want. This description appears in the Message Window at the bottom of your screen, and will appear just in front of the message that you place in the Message columns (columns 105-184). Both messages display when you place your cursor over the icon on the menu bar. |
| 15 - 22 | .BMP Filename | Contains the .BMP file name of the icon button. This can be a standard DataCAD icon, or one that you create. |
| 24 - 103 | Action | Contains the action to perform - i.e. the menu or macro to access or the keyboard sequence to perform. This is where your knowledge of Keyboard Macro Files comes in -- all the symbols and commands are the same, with a few additional tricks added for good measure. See the list of "Known Symbols and Commands" for what can go in here. |
| 105 - 184 | Message | Contains the message, or description of the icon/macro function (see the description above for "Menu Level String"). 79 characters are possible, but you probably want to keep it short and readable. |
| | | | | |
*|01| | | | |
L| | |S_ERASE2|9 |2D Erase menu |
L| | |S_MOVE2 |1 |2D Move menu |
L| | |S_COPY2 |2 |2D Copy menu |
L| | |S_MIRROR|4 |2D Mirror menu |
L| | |S_STRETC|5 |2D Stretch menu |
A| | |STRCHP_S|;^S9^S8^F2^DCX2^$^STRCHPT^$ |Stretch Point Macro |
L| | |S_CHANGE|8 |Change entity attributes |
A| | |S_OFFSET|;^:^F6^F3^F2 |Offset Perpendicular Distance |
L| | |S_1LTRIM|50 |1 Line Trim |
L| | |S_2LTRIM|51 |2 Line Trim |
L| | |S_WELD-L|52 |Weld Line |
A| | |S_WELD-W|;^F9^F8 |Weld Wall |
A| | |S_FILLET|;^F9^F1 |Fillets |
L| | |S_MEASUR|26 |Measures menu |
L| | |S_TEXT1 |14 |Text menu |
A| | |DMENSN_S|;^S0^F8^F1 |Dimension - Linear |
L| | |3PTARC_S|36 |Arcs defined by 3 points |
L| | |2DWIND_S|56 |Architect - Windows menu |
L| | |2DDOOR_S|55 |Architect - Door Swing menu |
L| | |S_CLEANU|10 |Cleanup menu |
L| | |PLOTTR_S|27 |Plotter menu |
A| | |TOOLBX_S|;^S9^S8^F2^DCX^$ |Toolbox menu - DataCAD tools |
A| | |TOOLB2_S|;^S9^S8^F2^DCX2^$ |Toolbox DCX2 - DataCAD tools |
L| | |DICIRC_S|43 |Circles defined by diameter |
L| | |S_CURVES|13 |Curves menu |
C| | |DCAD3D_S|S_WMA3D |3D icon toolbar |
| | | | | | | | | | | Message (cols. 105-184)_____| | | | | |___Action (cols. 24-103) | | | |___pof filename (cols. 15-22) | | |___Menu Level String (cols. 6-13) | |___Not Used (cols. 3-4) |___Action Code (column 1)
Go To "Known Symbols and Commands" For Items to Go Into the "Action" and "Action Code" Columns.
The only drawback for the icon KEY files is that the total characters allowed in the ACTION column is limited to 80 characters. That may sound like a lot, but there are plenty of macros which could fill all of that space and still require more. Like the keyboard macros, any keystrokes you can make while in DCad can be recreated for a macro.
(Note that I have a directory called DCX and another called DCX2, where my macros are kept. For housekeeping purposes I use both of these instead of just DCad’s default DCX directory.)
You can edit and troubleshoot the .KEY files while you are still in DataCAD by using a plain text editor (one that does not save formatting), like Windows Notepad.