Note: A special thanks to Deepak Gupta, Filipe Venceslau, & Wayne Matus for answering my question on the SolidWorks Forums and for providing me the content for this blog post.
Did you just write that SolidWorks Macro that will solve ALL of the world’s problems? I recently wrote one (with help) that will not solve ALL of the world’s problems but at least it will solve 1 of mine.
However, if you are at all like me, I am a keyboard shortcut kind of guy so that I can keep my UI as clean as possible. So there in lies the problem. I wrote this super awesome macro but I didn’t really want to have a button on a toolbar that was only there so that I could assign a keyboard shortcut to it (see the normal macro button dialog box below).
So I asked the question on my original SolidWorks Forums Discussion if it was possible to assign a keyboard shortcut WITHOUT having to add a button and I was really happy to see that I could so here is how to do it (thanks to Wayne Matus).
So how would you go about doing this? Well, here you go and it is ACTUALLY extremely simple.
1. Create a folder called “Macros” in your SolidWorks install directory which is by default C:\Program Files\SolidWorks Corp\SolidWorks. You will notice that the address in the picture below is set to C:\Program Files\SolidWorks 2011\SolidWorks which I like to do in the case that I have multiple versions of SolidWorks installed on my computer (which I normally do).
2. Copy all of your macros (or only the ones that you will want to assign keyboard shortcuts too) into your new folder
3. Now if you go to add a keyboard shortcut (Tools > Customize > Keyboard tab) you will be able to select “Macros” from the Category dropdown. From there you will be able to assign a shortcut as you would with any other command.
I hope you find that as useful as I did. Enjoy!