Yes you can set the macro to run on SOLIDWORKS start. The method to run a macro on SOLIDWORKS startup is easy.
You'll have to simply modify the target for the SOLIDWORKS shortcut on the desktop. I would suggest you to create a new shortcut for this macro and rename that shortcut some meaningful so that in case you need to have this macro running in background or startup, you can use the other shortcut for running SW.
- Right click on the SolidWorks shortcut on the desktop.
- In the target line, adding a space then "/m".
- Then another space and "macro complete path"
Example: "C:\Program Files\SolidWorks\SLDWORKS.exe" "/m" "C:\Macro\Run Macro.swp" (the SW installation path may be different on your machine)
P.S. The quotes are very important, so you may copy and paste "/m" "C:\Macro\Run Macro.swp" and change the macro path.
Thanks for your reply!
Tried it, solidworks is starting up like usual, but at the startup screen i get the following error:
I've used the following path:
"C:\Program Files\SolidWorks Corp\SOLIDWORKS (2)\SLDWORKS.exe" "/m" "Y:\Autocad\SolidWorks\SolidWorks Templates Bretech\Macros\Force_props_at_save.swp"
Check and make sure that you can open/run the macro with the SOLIDWORKS else it will not work. In other words make sure macro is not corrupted
S-071414 is the solution id number from SOLIDWORKS knowledge base for fixing corrupted macro.
Apparently had a wrong line in my macro (used to work, but somehow added an unneeded quote sign).
Fixed it and works like a charm now! Thanks!
(on a side note, don't need it at this time, but can you add multiple macro's to it or are you limited to 1 macro?)
I'm not sure but here is a way out.
Make a master macro which has paths to other macros. And then in that macro you RunMacro2 command to run those macros. And in SOLIDWORKS startup, set the path for that master macro
You'd need a SOLIDWORKS Addin for a general solution!