×
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

Assigning shortcut to macro

Assigning shortcut to macro

Assigning shortcut to macro

(OP)
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

RE: Assigning shortcut to macro

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

RE: Assigning shortcut to macro

By

Quote:

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

RE: Assigning shortcut to macro

(OP)
Thank you folks.  This is the info that I require.

Best regards,

Chris Gervais
Application Engineer
CSWP, CSWST

RE: Assigning shortcut to macro

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

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