×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

hotkey macro
5

hotkey macro

hotkey macro

(OP)
Hi all,
F9 hides feature manager, F10 hides toolbars, Crtl-F1 hides design library.
Can a macro do all three, and undo with one key? Not having luck creating. Thanks

SW2009 sp3.0

RE: hotkey macro

If you have one...you could use a programmable key on your keyboard or keypad?

Or install http://www.autohotkey.com/...software version of a keyboard recorder. Then you assign some keystroke to playback the recording.

I have both a programmable keypad and Autohotkey installed, and I use one or the other daily.

RE: hotkey macro

Or if you have a motion controller Spaceball and such you can create a custom function and type the keystrokes you want to record and assign them to a button on your device.

AutoHotKey is a great program and it's free. My brother uses it quite a bit and has hotkeyed a ton of stuff on keyboard. He can type my email address out by just entering my initials.

 Or you can assign Design library key as F8 and press all three at once no need for a macro.

Michael

RE: hotkey macro

Yes, a macro can do this.  You'll need to find the magic key in the SW API that affected each one of those.  This is not an easy task, as the SW API help is very incomplete.

For keystroke macros, I use EZ Macros until I can find a method to apply a native method.

Matt Lorono
Lorono's SolidWorks Resources & SolidWorks Legion

&

RE: hotkey macro

(OP)
Thanks all,
Unfortunately T cant get to autohotkey and download beacause of company restrictions. ill have to use the three exiting keys for now, thanks

RE: hotkey macro

2
SendKeys is a base VBA function that emulates keystrokes.  You could easily write a one line macro to send all of these keystrokes.

-handleman, CSWP (The new, easy test)

RE: hotkey macro

CODE

Sub main()
Dim wait As Double
wait = Timer
While Timer < wait + 0.5
    DoEvents
Wend
SendKeys "{F9}{F10}^{F1}", True
End Sub

Map this macro to a shortcut key.

There is an 0.5 second delay timer in there.  The reason for it is to make sure you have let up on the shortcut key before the macro sends the keystrokes.  If you are still holding down a modifier key (shift, ctrl, alt, etc) that modifier will be added to the keys sent by the macro, and the wrong key will be sent.

-handleman, CSWP (The new, easy test)

RE: hotkey macro

(OP)
Thanks handleman
the macro works but the first three times I hit the shortcut hides each one at a time, the fourth time on the shortcut brings them all back.
I'm no API wizard but doesnt the code instruct all off at the same time?

RE: hotkey macro

Odd... it works for me.  Perhaps breaking it up as Matt suggested.  You can add more timers if you want to make sure each gets processed.  Just make sure on the F1 you include the caret/hat (^) in front.  That makes it Ctrl-F1.

-handleman, CSWP (The new, easy test)

RE: hotkey macro

(OP)
It does work as listed. I was trying to add F11 as well. It does not seem to want to toggle the full screen view

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources