How to get userCommand of third party add-in without executing the command?

Dear all,

In my add-in I need to monitor if specific commands of third party add-ins are fired. If the commands are fired I need to run some code.

What I am currently doing is to use CommandOpenPreNotify event to get the userCommand of the fired command. After I have the userCommand I store it in the user settings of my add-in. Since the userCommand can vary between users and I need three commands to monitor, it is a hassle for our IT guy to install the add-in for all the users (>20 users).

I attached a movie clip in a zip file of the way I am handeling it now.

What I would like to do (by code) is:

  • find a loaded add-in with a specific name
  • get all commands of that add-in
  • get a specific command by name
  • use the userCommand of that command in my code

In this way it will work for all users, even if the commands have different userCommands across users.

I hope my question is clear and that there is anyone out there to help me.

Thanks in advance.

Best regards,

Dennis.

SolidworksApi macros