Macro with multiple subs without references.
Posted: Wed Mar 01, 2023 11:42 am
Again something learned.
I just finished a new macro, where I worked for the first time with multiple subs to structure the code a bit. One of the additional subs has no reference
The macro worked without problems in the editor. If the mouse pointer did not point to the sub main, I had to select in the popping up window which sub should be executed.
The tide turned when I tried to start the macro with the execute button. Then nothing happened!
A post in the good old forum brought me to the right track: https://forum.solidworks.com/thread/226354
In my ignorance I assumed that the execute button always calls the sub main. But that is probably not so!
If you create your own button for the macro, you can specify the start procedure. But what do you do if you have macros that are only started by the execute button?
Add a reference to all additional subs, or change the subs without references to function, so that only the sub main is left to start?
Or are there other solutions? What is the clean way?
I just finished a new macro, where I worked for the first time with multiple subs to structure the code a bit. One of the additional subs has no reference
The macro worked without problems in the editor. If the mouse pointer did not point to the sub main, I had to select in the popping up window which sub should be executed.
The tide turned when I tried to start the macro with the execute button. Then nothing happened!
A post in the good old forum brought me to the right track: https://forum.solidworks.com/thread/226354
In my ignorance I assumed that the execute button always calls the sub main. But that is probably not so!
If you create your own button for the macro, you can specify the start procedure. But what do you do if you have macros that are only started by the execute button?
Add a reference to all additional subs, or change the subs without references to function, so that only the sub main is left to start?
Or are there other solutions? What is the clean way?