Hello all,

 

I have a macro that is saved to an internal server of my office. I have multiple users who have buttons, keyboard shortcuts, etc that are linked to this macro.

 

If I want to update this macro for added functionality, I have to have EVERYONE close out of solidworks, save over the macro, and then everyone has to "reattach" the macro in their buttons again once they open up solidworks.

 

Is there a better way around this? Something I can do programmatically?


Categories: API∕Macros

Comments
Last comment By: William Miller   Mon, 16 Apr 2018 18:16:59 GMT
Re: Multiple users using same macro, How to save over it without everyone shutting down solidworks?

I got around this issue by writing a macro that called the my macro using the RunMacro2 API call and setting the Options parameter to swRunMacroUnloadAfterRun. Doing it this way allows me to edit the "real" macro while not requiring other users to close SolidWorks.  So far it has worked well for me; maybe for you too.

By: Solid Air  Sat, 14 Apr 2018 00:12:25 GMT
Re: Multiple users using same macro, How to save over it without everyone shutting down solidworks?

So your calling out the "real" macro from within the macro that all the users run, correct?

 

This issue seems to have only started with SOLIDWORKS 2017, we used to ALWAYS be able to update macros, then just have the users "get latest" from the vault and continue using the macro (just updated).  What changed inside of SOLIDWORKS that no longer lets this work in this manner?

By: Tom Cote  Sat, 14 Apr 2018 12:26:54 GMT
Re: Multiple users using same macro, How to save over it without everyone shutting down solidworks?

 

So your calling out the "real" macro from within the macro that all the users run, correct?

 

This issue seems to have only started with SOLIDWORKS 2017, we used to ALWAYS be able to update macros, then just have the users "get latest" from the vault and continue using the macro (just updated). What changed inside of SOLIDWORKS that no longer lets this work in this manner?

Yes that is correct.  And by using the unload option, the user is disconnected from the macro allowing me to edit when needed without calling our network admin to unlock the file.

 

This has been an issue long before SW2017 (I personally have been dealing with it since SW2010 and we are currently on SW2016).

 

I do not understand why you are having an issue when your users get latest version of the macros from the vault.  This sounds like a VAR question (unless another forum member has had this issue).  We plan on using this method when we upgrade to SW2018 later this year.  Something I will need to check during our testing phase,

By: Solid Air  Sat, 14 Apr 2018 15:07:14 GMT
Re: Multiple users using same macro, How to save over it without everyone shutting down solidworks?

Great idea! I will experiment with it when I get back to the office on Monday. You wouldn't happen to have an example of code would you? Do I need to add any particular references?

By: William Miller  Sat, 14 Apr 2018 17:52:01 GMT
Re: Multiple users using same macro, How to save over it without everyone shutting down solidworks?

There is an example when you look up RunMacro2 in API help.  No special references required that I am aware of.

By: Solid Air  Sat, 14 Apr 2018 21:20:32 GMT
Re: Multiple users using same macro, How to save over it without everyone shutting down solidworks?

Got it working. Thanks for the idea Solid Air!

By: William Miller  Mon, 16 Apr 2018 18:16:59 GMT
You are not authorized to view this page No results found! Suggestions: Check spelling, try a different search, or browse topics below.