How to assign multi-key hotkeys in SW...and more.

Discussion in 'SolidWorks' started by Tin Man, Apr 5, 2006.

  1. Tin Man

    Tin Man Guest

    You can do it but it requires using a macro, see below for explaination
    (sorry it's so long/wordy).

    The macro is called HotkeyCommander. The reasons I wrote the macro were
    to
    -Allow Hotkeys in SolidWorks to be created that are multipe-character
    combinations long.
    -Simulatate a CommandLine interface/behavior in SolidWorks similar to
    AutoCAD's for running macros.
    -Create an interface that would commonize macro use and Hotkey
    combinations among multiple Users.
    -Easily repeat the last run macro command.

    Basically all the macro does is list a bunch of other macros with their
    descriptions and allow you to run those other macros right from the
    HotkeyCommander macro interface. To run the other macros, you just have
    to enter a Hotkey combination in the dialog box (which can be set to
    any alpha-numeric combination from as little as one-character to a
    combination with any number of characters you want to use), or there is
    a more graphical display interface available too (hit the Expand button
    and look at the bottom of the dialog box) that lists the macros by
    categories.

    There is an Excel file, HotkeyCommander.xls, that is used to
    organize/sort/keep track of all the macros and it creates the data
    file, HotkeyCommander.csv, that the HotkeyCommander macro uses to
    display/find the other macros.

    There is a text file, HotkeyCommander-README.txt, included that should
    be looked at first after unzipping. It contains thorough instructions.
    Additional instructions are in the Excel file to help in editing it as
    well.

    The HotkeyCommander macro is already set up to run 39 "other"
    macros that are included in the zip file. Some of these are macros I've
    accumulated over the years that were written by others, and some of the
    other macros were started from someone else's macro and modified. The
    rest were done be me. I've left the original author's information in
    the macros if available as well as provided a list of acknowledgements
    and links in the text file.

    Some of those 39 macros can perform multiple different functions, so
    there are actually 57 different macro "Hotkey" calls already
    available in the HotkeyCommander.

    Some of the most frequently used hotkeys/commands by me are:
    0/Change Precision to 0 place (primary units) and appropriate precision
    alt units (for inch and mm).
    1/Change Precision to 1 place (primary units) and appropriate precision
    alt units (for inch and mm).
    2/Change Precision to 2 place (primary units) and appropriate precision
    alt units (for inch and mm).
    3/Change Precision to 3 place (primary units) and appropriate precision
    alt units (for inch and mm).
    4/Change Precision to 4 place (primary units) and appropriate precision
    alt units (for inch and mm).
    UT/Toggles document units between INCH and MM.
    DEF/Sets document settings to default values.
    UTD/Toggles document units between INCH and MM and sets document
    settings to default values.
    MC/Add Coincident Mate
    MO/Add Concentric Mate
    MP/Add Parallel Mate
    SO/Show Only Selected Components.
    SA/Show All Components.
    C/Change part color to a random color.
    CC/Remove all colors from part

    With my "wordy" instructions and the existing structure, it should not
    be hard to set this up, start using it, and start adding your own
    macros to it if desired.

    Download the macro at the location below and let me know what you
    think.
    http://kcswug.com/programs/macros/HotkeyCommander.zip

    ***************************
    Other points to ponder to possibly increase efficiency:

    Another driving reason to write the HotkeyCommander macro was that I
    was out of single-keystroke Hotkeys. I ran out of keys because I can't
    stand hunting thru all the different RMB menus, so many of the keys
    were assigned to native SW commands as well as macros.

    I find the [Shift]+? or the [Alt]+? combinations to be very cumbersome
    and painful to my wrist. I do use [Ctrl]+? combinations, but only for
    keys within a range of about 3 rows away from the left side [Ctrl] key.
    And [Shift]+[Ctrl]+? combinations are nearly impossible with one hand.

    Now with the HotkeyCommander macro available, I have all 26 letters and
    all of the [Function] keys mapped as Hotkeys....only 4 of those call
    macros. All of the other keys are set to initiate native SW commands
    (like draw Sketch Line, or Sketch Circle, or Mate, or Move, etc...). So
    with the HotkeyCommander macro used (nearly) strictly for macros, that
    freed up many keys on my keyboard to be assigned to the native SW
    commands.

    An additional note not related to the HotkeyCommander macro...I have
    found a mouse with programmable buttons to be very useful as well. Now
    on my mouse I can have buttons for [Enter], [Shift], [Ctrl],
    [Shift]+[Ctrl], Isometric View. Notice that with the [Shift], [Ctrl],
    and/or [Shift]+[Ctrl] capability with the hand at the mouse, this could
    open up 3 whole new keyboards of possible native SW Hotkeys that will
    only require your non-mouse hand to hit one key.

    Lastly, currently I use a programmable keypad for my views, and have
    found it pretty handy. It is set up (similarly to the keypad macros
    Wayne Tiffany has encouraged use of) with the 5 as Front, 8 as Top, 2
    as Bottom, 4 as Left, 6 as right, etc...And since my programmable
    keypad setting on the left (i.e. non-mouse) side of the keyboard, I can
    change views with single-keystrokes. This is another method that hasn't
    let SW force me into relying on the [SpaceBar] for View Orientations,
    and has allowed me to instead use the [SpaceBar] to call the
    HotkeyCommander macro without causing me any withdrawl issues :^).

    Let me know what you think,
    Ken
     
    Tin Man, Apr 5, 2006
    #1
  2. Tin Man

    John Layne Guest

    Thanks,

    This looks like something I've wanted for years, I'll install when I have
    little more time to read and understand the instructions.(Just worked 18
    hours straight)

    The way hotkeys are handled currently in SolidWorks drives me crazy, AutoCad
    10 was way better than the stupid system currently in SolidWorks. I did read
    on this newsgroup that this will change for the better in SWX2007.

    John Layne
    www.solidengineering.co.nz



     
    John Layne, Apr 5, 2006
    #2
  3. Tin Man

    Bo Guest

    I would instantly look at Quickeys for Windows.

    What is QuicKeys?
    QuicKeys offers flexible, yet powerful tools that redefine the way you
    use your PC. It takes the daily tasks that would normally require you
    five...six...twenty or more steps and turns them into simple one step
    shortcuts

    www.quickeys.com

    You can do so many repetitive things so much faster that it deserves a
    good trial. Inexpensive piece of really time saving software.

    Bo
     
    Bo, Apr 5, 2006
    #3
  4. Tin Man

    Tin Man Guest

    My only complaint is that there will always be one key to launch it, and then the command alias.<<<

    Yes, that is a limitation. Plus you have to hit [Enter] to run the
    macro that you just key'd in. I find that mapping the [SpaceBar] to
    call the HotkeyCommander macro does make this limitation A LOT easier
    to live with.

    That was best I came up with to solve that too...way too much
    maintenance. I had kicked around the idea of "S" calling all Sketch
    macros, "P" for Part file macros, but again a lot more maintenance.
    Plus what to do if a macro will work for multiple file types, like the
    UnitsToggle.

    That sounds like a huge undertaking...but I'll put it on my list of
    possibilities. For now you could print off a hardcopy of the list in
    the Excel file for reference or use the "graphical" interface at the
    bottom, "Expanded", section for awhile.

    Talk to you later,
    Ken
     
    Tin Man, Apr 6, 2006
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.