Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IRstuff on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning shortcut to macro

Status
Not open for further replies.

RawheadRex

Mechanical
Feb 9, 2001
236
Hi All,

If someone has located their macros on a network drive (and flagged this in the appropriate SW settings) is it possible to assign a keyboard shortcut to the individual macros using the customize dialog? It isn't obvious to me that I can drill down any further to get at the individual macro files.

I would appreciate any feedback.

Thanks,

Chris Gervais
Application Engineer
CSWP, CSWST
 
Replies continue below

Recommended for you

Whenever you create a button for the macro, you can just fill in the keyboard shortcut there. Otherwise, Tools > Customize, and when the dialog box pops up, right-click a button on the macro toolbar that you added, and you can add the keyboard shortcut.

Flores
SW06 SP4.1
 
By
flagged this in the appropriate SW settings
do you mean Tools/Options/System Options/File Locations/Macros? As far as I've been able to discover, this is only the default path when Creating/Editing a macro.

The only macros that will show up available at Tools\Customize\Keyboard\ will be macros located in your <sw install dir>\macros.

The method described above by smcadman is the only way I know to accomplish what you want with the native SW stuff.

Ken
 
Thank you folks. This is the info that I require.

Best regards,



Chris Gervais
Application Engineer
CSWP, CSWST
 
To allow my users to maintain their own macros, yet at the same time, keep standard ones available, I use call macros and place them into each user's own solidworks\macro folder. These macros call the original macro from the network drive, but do so from the user's own computer.

This allows me to edit the standard macros without having to redistribute them, while giving the users freedom to set up whatever they need to for themselves.

Something basic like this works:

'Run Macro

Option Explicit

Public swApp As Object
Dim retval As Boolean
Dim boolstatus As Boolean

Sub main()

Set swApp = Application.SldWorks

Dim filename As String

filename = "R:\SolidWorks Applications\CephSetTextboxWidth.swp"

boolstatus = swApp.RunMacro(filename, "SetTextboxWidth1", "main")

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor