0% found this document useful (0 votes)
96 views8 pages

Multiple Accudraw Shortcut Files: by Seth M. Cohen, Prosoft Net

The document discusses creating multiple AccuDraw shortcut files in MicroStation to allow for more than two character shortcuts. It describes how to set up a BASIC macro that loads different AccuDraw shortcut files, and recommends storing individual user shortcut files in their roaming profiles on a network for flexibility.

Uploaded by

Sabina Shrestha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views8 pages

Multiple Accudraw Shortcut Files: by Seth M. Cohen, Prosoft Net

The document discusses creating multiple AccuDraw shortcut files in MicroStation to allow for more than two character shortcuts. It describes how to set up a BASIC macro that loads different AccuDraw shortcut files, and recommends storing individual user shortcut files in their roaming profiles on a network for flexibility.

Uploaded by

Sabina Shrestha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

MULTIPLE ACCUDRAW SHORTCUT FILES

By Seth M. Cohen, ProSoft NET


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 SHORTCUTS
The 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:
1) Open the Reference File Dialog box
2) Select all the reference files
3) Click the display toggle on the Reference File Dialog to off
4) 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.

Figure 1 Figure 2
© 2004 ProSoft NET
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:
a. Press the ESC key
b. Assign the following key-in to a function key: ACCUDRAW DIALOG MAIN.
Whenever you need focus in AccuDraw, press the Function Key.
c. 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 carpotunnel syndrome from trying to activate the ALT+CTRL+Shift+F8 function key.

LIMITATIONS OF ACCUDRAW SHORTCUTS


This 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 FILES


This 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

© 2004 ProSoft NET


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 fileName as String
4. Dim strTemp as string
5.
6. MbeSendCommand "NoEcho"
7.
8. fileName = Command$
9.
10. strTemp = "c:\bentley\workspace\system\data\" & fileName & ".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, please feel free to skip to the section titled “Getting
The Files In The Right Place”.

1) The first three lines (after Sub main) define variables.


2) 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.
3) “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 fileName.

Here is an example.
Shortcut = C1
Key-in = MACRO SHORTCUT COLORS

© 2004 ProSoft NET


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.
4) 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.
5) Next we redefine the value of the MS_ACCUDRAWKEYS variable to equal strTemp.
6) Then we Send a Command to MicroStation with the key-in ECHO, which re-initializes the
messages display.

GETTING THE FILES IN THE RIGHT PLACE


Now we need to look at where to put our AccuDraw shortcut file. A few questions need to be answered
first.

1) Are you running a network setup (i.e. your workspace is located on a server) and users have
roaming profiles?
2) Are you running a localized setup (MicroStation “out of the box”)?
3) Will users be responsible for creating their own shortcut files or will one user maintain the
files?
4) 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.

Network Setup using Roaming Profiles and 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:


1. 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>.
2. 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\.
3. 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

© 2004 ProSoft NET


$(_USTN_WORKSPACEROOT)standards/. If you’re not sure of what I am talking about, please
call me (really, I mean it).
4. The strTemp variable in the macro.
In the macro shown above, strTemp is defined as “c:\bentley\workspace\system\data\" &
fileName & ".txt". For the macro to find the shortcut files in the user’s roaming profile, we must
change strTemp to:

strTemp = "$(PROFILE)\shortcuts\" & fileName & ".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.

Local Setup and 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”

© 2004 ProSoft NET


“MM” “Macro and mdl shortcuts” “MACRO SHORTCUT MACROSANDMDLS”

Note the 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 that all the shortcuts contain the key-in MACRO SHORTCUT SHORTCUT along with the desired shortcut.
Additionally, 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 the 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 "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 that all the shortcuts contain the key-in MACRO SHORTCUT SHORTCUT along with the desired shortcut.
Additionally, 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:

© 2004 ProSoft NET


1. An MDL utility called ALTKEYIN
2. 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:
1) Put the focus in the AltKey-In field
2) Press the Up and Down keys on the keyboard to cycle to the desired key-in(s)
3) Select the text
4) 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? E-mail
[email protected], and we will e- mail 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:

1. Choose Utilities > Create Macro… from the MicroStation pull-down menu
2. Give the macro a name. Notice the Record Macro dialog appears (see figure 4)
3. Choose/pick the commands that you wish to extract
4. Click the Stop button on the Record Macro dialog to stop the macro from recording
5. Choose Utilities > Macros and notice the Macros dialog points to the newly created macro
6. Open the macro to see the key-ins that were invoked
7. 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

© 2004 ProSoft NET


Reasons to try AccuDraw
Implementing 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 ProSoft, 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:

1) Typical Sections with pull-downs and icons only – 1 ½ hours


2) Typical Sections using AccuDraw shortcuts only – 45 minutes

As you can see from this test, using AccuDraw shortcuts increased my productivity by two!

Conclusion
Am 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 e- mail [email protected], and
we will send you the ZIP file.

Take back your MicroStation desktop and increase your drafting productivity today, with the use of
multiple AccuDraw shortcuts!

Seth M. Cohen is a technical writer for ProSoft NET 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 [email protected] and by phone at 207-781-7000 or
888-781-7000 (toll-free).

© 2004 ProSoft NET

You might also like