API: example of how to add macro to rmb

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

Thanks

Reply to
Sam
Loading thread data ...

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

formatting link
't remember if it handles RMB).

Reply to
Philippe Guglielmetti

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

Reply to
Sam

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

Reply to
Willem1

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.