API: example of how to add macro to rmb

Discussion in 'SolidWorks' started by Sam, Apr 5, 2008.

  1. Sam

    Sam Guest

    Can anyone provide an example of how to add a macro to the rmb in
    solidworks.

    Thanks
     
    Sam, Apr 5, 2008
    #1
  2. You can't. There are very few limitations of macros compared to add-
    ins, but this is one : you can't use the callback functions system
    from macros, so you can't handle menus from macros.

    Callback functions are those called when you call a toolbar button, or
    a menu (regular or rmb). Those callback functions have to be in a DLL.
    Check Frame::AddMenuPopupItem in API help to see how it works.

    A nice way to circumvent this limitation is to build an addin which
    can be parametrized to build toolbars and macros and then call
    specific macros. Axemble (french VAR) has made something like this for
    their set of tools you can get from here http://www.mycadservices.fr/mycad/portal/anon/Utilitaires
    (don't remember if it handles RMB).
     
    Philippe Guglielmetti, Apr 6, 2008
    #2
  3. Sam

    Sam Guest

    Sorry, I should clarify... My "macro" is an add-in.

    I think Frame::AddMenuPopupItem is what I am looking for, I tried the
    web site you referenced but I do not speak french so I could not
    understand it.

    Would you happen to have an example in english?




    Thanks,

    Sam
     
    Sam, Apr 7, 2008
    #3
  4. Sam

    Willem1 Guest

    In SW2008 you can easily add extra commands (and macros) to the menu
    that pops-up after hitting the "S" on the keyboard.

    (Don't know if this is where you looking for)
    \/\/illem
     
    Willem1, Apr 8, 2008
    #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.