Multiple AccuDraw Shortcut FilesBy Seth M. Cohen, Rowse Company Is your MicroStation desktop cluttered with toolframes & toolbars? Are you sacrificing precious desktop real estate because “YOU GOTTA HAVE THAT ICON”? If so, then creating multiple AccuDraw key-in shortcuts will let you reclaim your desktop! What is AccuDraw? According to the MicroStation/J help, “AccuDraw is a drafting aid that evaluates such parameters as your current pointer location, the previously entered data point, the last coordinate directive, the current tool's needs, and any directive you have entered via either keyboard shortcuts or AccuDraw options. AccuDraw then generates the appropriate precision coordinates and applies them to the active tool”. The topic that we will be discussing is AccuDraw shortcuts. AccuDraw ShortcutsThe functionality of AccuDraw shortcuts is to run MicroStation key-in commands. This is accomplished by the user creating a shortcut to a desired key-in by associating two alphanumeric characters to that key-in. Here is an example of how to create an AccuDraw shortcut, and how they can make drafting more efficient, and increase your MicroStation desktop. Wouldn’t it be nice if you could turn off the display of, let’s say, 150 reference files without having to: - Open the Reference File Dialog box
- Select all the reference files
- Click the display toggle on the Reference File Dialog to off
- Click the Update All icon to refresh the view
Well with AccuDraw, you could set two shortcuts to toggle all the reference files on and off. Here’s how: First, we will define two shortcuts that will act like switches. The shortcuts are, R0 and R1. R0 would turn all reference files off, and R1 would turn all reference files on. To accomplish this, open AccuDraw by keying in ACCUDRAW DIALOG MAIN, or click the AccuDraw icon on the primary toolbar. When the AccuDraw window appears, press the question mark (Shift + /), which will open the AccuDraw shortcuts window (see Figure 1). Click on the New button. When the Edit Shortcut Dialog appears, type in the following data (see Figure 2): Shortcut – R0 Description – all ref’s (display) off Command – REFERENCE DISPLAY OFF ALL;UPDATE ALL Choose OK.  Figure1
 Figure 2
For the shortcut that turns on all reference files, click the New button again but replace the Shortcut field with R1, and replace “OFF” (in the Command field) to “ON”. That’s it! Now, when you want all 150 reference files turned OFF or ON, type R0 or R1. Here are a couple of tips on using AccuDraw shortcuts: 1. For AccuDraw shortcuts to work correctly, the AccuDraw Window will need the “focus”. To move the focus to the AccuDraw Window, the following can be done: - Press the ESC key
- Assign the following key-in to a function key: ACCUDRAW DIALOG MAIN. Whenever you need focus in AccuDraw, press the Function Key.
- To assure that the focus stays in the AccuDraw Window as much as possible, choose Workspace > Preferences > Category-Tools, and toggle the Auto-Focus Tool Settings Window OFF.
2. MStoys.ma* is an MDL that adds the key-in commands ACCUDRAW ROTATE ELEMENT and ACCUDRAW SUSPEND. These key-in commands rotate the AccuDraw compass to the angle of any element and temporarily suspend AccuDraw, respectively. 3. You can string commands together by using a semi-colon(;). Doing this reduces the amount of “clicks” or movement that you will have to do with the mouse. An example of this would be: Shortcut - CB, Command - REFERENCE CLIP BOUNDARY;ALL;CHOOSE ELEMENT. This shortcut will clip the boundary of all reference files, after a fence is defined (and you don’t even have to open the Reference File dialog or Reference tool box). *To obtain a copy of this MDL go to the following web address: http://www.mindspring.com/~rob.brown/microstation/mstoys/mstoys.html "Hey Seth, What About Function Keys?"Now you might be saying “Why should I use AccuDraw? I could use function keys.” Well one major advantage of AccuDraw shortcuts is that you can make shortcuts that make sense. Unlike using Function Keys (F1, F2, ALT+CTRL+F1, etc.) AccuDraw shortcuts can “sound” like the key-ins they are created for. For example the Copy command could be CO, the Rotate command could be RO, etc. Plus, you won’t get carpal tunnel syndrome from trying to activate the ALT+CTRL+Shift+F8 function key. Limitations of AccuDraw ShortcutsThis is not to say that using AccuDraw shortcuts does not have its limitations as well. One limitation is that there is no way to have single letter and two letter shortcuts that begin with the same letter. In other words, you can’t have a shortcut Z and ZW. Another one of AccuDraw’s limitations is that you can only have up to two-character shortcuts. This limitation can be very frustrating when developing a list of shortcuts meant to improve your productivity. For instance, let’s say you wanted to create a shortcut for the Copy command (key-in COPY EXTENDED). The obvious two-letter shortcut would be CO. What if CO were already taken? And CP? And CY? There is no way to get by this limitation of AccuDraw’s functionality. Until now. Multiple AccuDraw Shortcut FilesThis brings us to the main subject of this article. How can we allow MicroStation to use more than two characters for shortcuts? The answer is simple. We can create a MicroStation BASIC macro that acts like a switch, and loads another AccuDraw shortcut file for you. With help from a former fellow employee of mine, David Munro, P.E., a Project Engineer at CLD Consulting Engineers Inc. in Manchester NH, we created such a macro. Here is the Macro: 'Shortcut.bas - Used to Load Accudraw Shortcut files ' 'Assumes custom shortcut files are in location: 'c:\bentley\workspace\standards\data\ 'Command syntax: "MACRO SHORTCUT SHORTCUTS" 'where "shortcuts" is the shortcut file to be called. 1. Sub main 2. Dim status as Integer 3. Dim cmd as String 4. Dim strTemp as string 5. 6. MbeSendCommand "NoEcho" 7. 8. cmd = Command$ 9. 10. strTemp = "c:\bentley\workspace\system\data\" & cmd & ".txt" 11. status = MbeDefineConfigVar("MS_ACCUDRAWKEYS",strTemp) 12. MbeSendCommand "ACCUDRAW SHORTCUTS READFILE" 13. 14. MbeSendCommand "Echo" 15. End Sub
You don’t have to be a programmer to understand how the BASIC program is working. Here is a breakdown of the code. If you don’t care to know, send me an email and I’ll send the macro to you. - The first three lines (after Sub main) define variables.
- Line 6 is very important for certain shortcuts. "No Echo" tells MicroStation not to display messages like "MACRO <macro file> LOADED " etc. in the message area (any messages in the lower right corner). By disabling the messages from appearing, the user has full sight of the current snap mode, selection set count, etc.
- "Command$” is a MicroStation BASIC command that returns a string representing the argument from the command line used to start the macro. In other words, any text entered after the key-in " MACRO <macro file>" will get sent to the Command$ string variable, which I have equated to cmd.
Here is an example: Shortcut = C1 Key-in = MACRO SHORTCUT COLORS
This key-in runs the macro shortcut.ba and passes “COLORS” to Command$. The macro then takes COLORS and stores it in the variable cmd.
- Then, we define the variable strTemp to equal the path (default) of the shortcut files, and we append (&) the contents of the cmd variable with a TXT extension. The TXT extension is added so we don’t have to type .txt in every AccuDraw shortcut that we use to call another file.
- Next we redefine the value of the MS_ACCUDRAWKEYS variable to equal strTemp.
- Then we Send a Command to MicroStation with the key-in ECHO, which re-initializes the messages display.
Getting the Files in the Right PlaceNow we need to look at where to put our AccuDraw shortcut file. A few questions need to be answered first. - Are you running a network setup (i.e. your workspace is located on a server) and users have roaming profiles?
- Are you running a localized setup (MicroStation “out of the box”)?
- Will users be responsible for creating their own shortcut files or will one user maintain the files?
- Do you wish to stay in the shortcut file that you call, or do you want to revert back to a “master shortcut file” once the shortcut loaded is executed (will expand on this later).
Here are some suggestions for implementing multiple AccuDraw shortcut files defined by each setup. A. Network Setup Using Roaming Profiles & The Master Shortcut File (preferred setup) This setup requires that you create and store the AccuDraw shortcut files in the user’s roaming profile. This is a great way to allow each user at your site to maintain/create their own shortcut files. This way, each user will create/assign shortcuts that make sense to them. Additionally, the user can log onto any machine in the network (with MicroStation loaded on the machine) and use their shortcut files. The following is a list of items that will need to be changed/edited: - Initial definition of MS_ACCUDRAWKEYS in a site configuration file.
An example of this is: MS_ACCUDRAWKEYS = $(PROFILE)shortcuts/shortcut.txt The $(PROFILE) variable, uses the WinNT environment variable $(USERPROFILE) to expand the variable definition to c:\winnt\profiles\<user login name>\bentley\shortcuts\shortcut.txt. Be careful if you change over to Windows 2000 Professional, as the $(USERPROFILE) variable is defined as c:\documents and settings\<user login name>. - Define the folder location of the Multiple AccuDraw Shortcut files. This is up to you where you wish the shortcut files to be located, but I recommend using the location that is already defined in step number one. The folder location defined in step 1 is c:\winnt\profiles\<user login name>\bentley\shortcuts\.
- Place the macro in a path defined by MS_MACRO.
Usually, a folder(s) exists on the network where macros are placed for all users to have access to. This folder is defined by the MicroStation variable MS_MACRO. An example definition of MS_MACRO is: MS_MACRO > $(_USTN_SITE)macros/. _USTN_SITE expands to $(_USTN_WORKSPACEROOT)standards/. If you’re not sure of what I am talking about, please call me (really, I mean it). - The strTemp variable in the macro.
In the macro shown above, strTemp is defined as “c:\bentley\workspace\system\data\" & cmd & ".txt". For the macro to find the shortcut files in the user’s roaming profile, we must change strTemp to: strTemp = "$(PROFILE)\shortcuts\" & cmd & ".txt".
You also have the option to place the shortcut files in one location that only a certain group of individuals have access to. Then you can then set network permissions to allow which users will maintain and create the shortcut files. You still have to complete the steps above, except the definition of the location folder and the Master Shortcut file (Steps 1 and 2) are set to a folder that all users can share on the network. B. Local Setup & The Master Shortcut File (using MicroStation “out of the box”) The local setup is the easiest of all. The only requirement is to create/edit the AccuDraw shortcut files and place them in the default location defined by MS_ACCUDRAWKEYS (c:\bentley\workspace\system\data). The only other requirement is that you place the macro in a location where MS_MACRO is defined (c:\bentley\workspace\system\macros). What do I mean by “The Master Shortcut File”?AccuDraw shortcuts and files can be setup in two ways: Method 1: Use a master shortcut file, and when the macro is used to switch to another file, each shortcut in that “switched file” will be created so that they switch back to the master shortcut file.
Method 2: When the macro is called to switch to another file, the shortcuts in that file will be defined so that they don’t switch back to the master shortcut file, rather the user stays in the file called and can create a commonly named shortcut in each file that switches back to the master shortcut file .
I know, this sounds a little confusing, but it’s REALLY easy to setup. The table below helps better describe this: Method 1: Example shortcuts in The Master Shortcut File (shortcut.txt) | Shortcut | “Description” | Command key-in | | “AR” | “Rotate to element” | “ACCUDRAW ROTATE ELEMENT” | | “AZ” | “Sets az=0 and dp -5k,5k” | “AZ=0;SELVIEW 1;RESET;DP=-5000,5000;SELVIEW 1;RESET” | | “AT” | “Rotate top” | “ACCUDRAW ROTATE TOP” | | “BF” | “Wset add” | “WSET ADD;WSET DROP;UPDATE ALL” | | “C1” | “Color table shortcuts” | “MACRO SHORTCUT COLORTABLES” | | “CA” | “Change attributes” | “MDL L CHANGEBY;CHANGE ELEMENT EXTENDED” | | “DI” | “Dialogs” | “MACRO SHORTCUT DIALOGBOXES” | | “MM” | “Macro and mdl shortcuts” | “MACRO SHORTCUT MACROSANDMDLS” |
Note: shortcuts bolded. These shortcuts call other shortcut files via the macro.
Example shortcuts in the dialogboxes.txt shortcut file | Shortcut | “Description” | Command key-in | | “CL” | "Config variables" | "MACRO SHORTCUT SHORTCUT; MDL L CFGVARS" | | “FK” | "Function key menu" | "MACRO SHORTCUT SHORTCUT; DIALOG FUNCKEYS" | | “FN” | "Font settings" | "MACRO SHORTCUT SHORTCUT; DIALOG FONT" | | “WU” | Working units | “MACRO SHORTCUT SHORTCUT; DIALOG UNITS” | | “ZZ” | "Shortcut" | "MACRO SHORTCUT SHORTCUT" |
Note: all the shortcuts contain the key-in MACRO SHORTCUT SHORTCUT along with the desired shortcut. Also, the ZZ shortcut serves as an "oops, I pressed the wrong buttons" shortcut that restores you to the master shortcut file
Method 2: Example shortcuts in The Master Shortcut File (shortcut.txt) | Shortcut | “Description” | Command key-in | | AR | ROTATE TO ELEMENT | ACCUDRAW ROTATE ELEMENT | | AZ | SETS AZ=0 AND DP -5K,5K | AZ=0;SELVIEW 1;RESET;DP=-5000,5000;SELVIEW 1;RESET | | BF | WSET ADD | WSET ADD;WSET DROP;UPDATE ALL | | C1 | COLOR TABLE SHORTCUTS | MACRO SHORTCUT COLORTABLES | | CA | CHANGE ATTRIBUTES | MDL L CHANGEBY;CHANGE ELEMENT EXTENDED | | DI | DIALOGS | MACRO SHORTCUT DIALOGBOXES | | MM | MACRO AND MDL SHORTCUTS | MACRO SHORTCUT MACROSANDMDLS |
Note: shortcuts are bolded. These shortcuts call other shortcut files via the macro.
Example shortcuts in the dialogboxes.txt shortcut file | Shortcut | “Description” | Command key-in | | CL | "CELL LIBRARY" | "DIALOG CELLMAINTENANCE" | | CV | "CONFIG VARIABLES" | "MDL L CFGVARS" | | CZ | "CUSTOMIZE" | "MDL L CUSTOMIZ; CUSTOMIZ DIALOG" | | DF | "DESIGN FILE SETTINGS" | "MDL L DGNSET" | | DS | "DIMENSION SETTINGS" | "DIALOG DIMSETTINGS OPEN" | | FK | "FUNCTION KEY MENU" | "DIALOG FUNCKEYS" | | FN | "FONT SETTINGS" | "DIALOG FONT" | | ZZ | "SHORTCUT" | "MACRO SHORTCUT SHORTCUT" |
Note: all the shortcuts contain the key-in MACRO SHORTCUT SHORTCUT along with the desired shortcut. Also, the ZZ shortcut serves as an "oops, I pressed the wrong buttons" shortcut that restores you to the master shortcut file.
How do I find those key-ins?So, how do you find out all those key-ins? There are many ways to find out key-ins, but I am going to cover two, for brevity’s sake: - An MDL utility called ALTKEYIN
- Run the Macro Recorder tool
The first tool is an “Alternative key-in” to the MicroStation Key-In window. ALTKEYIN extracts any MicroStation key-in that you invoke by clicking on an item from the pull-down menus or from clicking an icon on a toolbox. ALTKEYIN “grabs” the key-in and populates the AltKey-In window (see figure 3).  Figure 3
To copy the key-in from the AltKey-In window: - Put the focus in the AltKey-In field
- Press the Up and Down keys on the keyboard to cycle to the desired key-in(s)
- Select the text
- Press CTRL+C to copy the text to the clipboard.
Now you can create your shortcut by pasting the command syntax into the command field of the Edit Shortcut dialog box. So, you ask, how do I get a copy of this awesome utility? Email info@rowseco.com, and we will email you the free ALTKEYIN utility. The second way to find your desired key-ins is to run the Macro Record tool. Here are the steps: - Choose Utilities > Create Macro … from the MicroStation pull-down menu
- Give the macro a name. Notice the Record Macro dialog appears (see figure 4)
- Choose/pick the commands that you wish to extract
- Click the Stop button on the Record Macro dialog to stop the macro from recording
- Choose Utilities > Macros and notice the Macros dialog points to the newly created macro
- Open the macro to see the key-ins that were invoked
- Copy the desired key-ins to the command field of the Edit Shortcut dialog box or create a shortcut that runs your newly created macro
figure 4
Reasons to Try AccuDrawImplementing AccuDraw shortcuts at your site can increase your productivity two-fold. I will explain this statement with a real life example. Prior to working with Rowse Company, I was a Highway Design Technician / MicroStation & InRoads Coordinator, supporting Engineers and Technicians with drafting and minor engineering tasks. My primary work involved Design for the Vermont Agency of Transportation (VTrans), New Hampshire Department of Transportation (NHDOT) and Maine Department of Transportation (MDOT). One of the tasks involved with Highway design is making revisions to a set of Roadway Plans that an Engineer would mark up (lot’s of red ink). Although user might find this task tedious and boring, I loved performing this task as it involved (for me) the use of AccuDraw shortcuts. I would challenge myself to create as many shortcuts that I needed without using any pull-downs or icons. This is of course why my Master Shortcut file contains approximately 150 shortcuts. One day, I decided to see if spending all this time creating these shortcuts was truly making me more productive, and wasn’t wasting company time. My test was to take a part of a set of plan sheets, time myself and perform all the edits without using any AccuDraw shortcuts (i.e. using pull-downs and icons only). Then, do the same edits using my AccuDraw shortcuts. I performed these edits on the “Typical Sections Sheets”. Typical sections are a set of plan sheets that show the cross sectional view of the designed roadway at major changes. Here are the results of this test: - Typical Sections with pull-downs and icons only – 1 ½ hours
- Typical Sections using AccuDraw shortcuts only – 45 minutes
As you can see from this test, using AccuDraw shortcuts increased my productivity by two! ConclusionAm I saying that you too can increase your productivity two-fold? Maybe not. What I am saying is to give AccuDraw shortcuts a try and you too will reap the benefits from one of MicroStation's best tools. Also, I am providing (free of charge) all my AccuDraw shortcut files and the macro used to switch between shortcut files in a convenient ZIP file. These shortcuts are over 7 years in the making, in 13 different shortcut files, and total more than 350 shortcuts in all! Simply email info@rowseco.com, and I will email you the free ZIP file. Take back your MicroStation desktop and increase your drafting productivity today, with the use of multiple AccuDraw shortcuts. About the AuthorSeth M. Cohen is a technical writer for Rowse Company and has been using MicroStation since 1995. He is a certified instructor for the MicroStation CAD Manager class, InRoads, InRoads Site and InRoads Survey. Seth can be reached at seth.cohen@rowseco.com and by phone at 207-781-7000 or 888-781-7000 (toll-free). Related Articles
|