I am looking for a way to force a macro to run whenever soldiworks is running. Is this possible or do i have to run the macro every time by hand?
I am looking for a way to force a macro to run whenever soldiworks is running. Is this possible or do i have to run the macro every time by hand?
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.
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:
"S-071414".
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?)
Here is another tool (paid but do have free trial) which can suit your needs AddItIn - Studio Zwaard
Deepak Gupta wrote:
.....
- 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.
I use to have a macro running on startup, as mentioned above, with SW2015 - Windows 7.
Yesterday I upgraded to SW2017 on Windows 10. I tried to apply the same modification in the Solidworks shortcut. SW starts as usual but the macro doesn't run with it. I have to run the macro manually.
Does anyone have the same problem? Could be Windows 10 the problem?
I found what's wrong.
In the shortcut property manager there are two links, one is the 'Target' and the other one is the 'Start in' folder.
When I installed SW on the new PC, the shortcut created automatically by the installer had the 'Target' link greyed out. In fact I realised I was modifying the 'Stat in' link.
Then I had to delete the shortcut and create a new one, by fetching the path from the SLDWORKS.exe (CTRL+SHIFT+drag).
That last one was editable.
Deepak Gupta, Would something like this work for getting Solidworks to prompt me to save soon as I start a part from a model template? I would like Solidworks to open the save dialogue box soon as I start a new part from my template. I thought 10-15 years ago there was an option for this but I have dug through all the option settings and I don't see anything regarding a "save upon opening" check box.
Mike, yes it can be done via Event Notifiers (there are many example on this forums) and you need FileNewNotify2EventHandler
I lost. So when I open my part it takes the template and turns into a part file extension. that this point how does it know to run the macro to open up the save dialogue box? This seems like crazy talk all the forums I'm trying to read up on. Guess its over my head. I'll just keep doing the save as usual till I learn more about this macro stuff. You guys are way to smart for me :-)
Mike Flanders wrote:
I lost. So when I open my part it takes the template and turns into a part file extension. that this point how does it know to run the macro to open up the save dialogue box? This seems like crazy talk all the forums I'm trying to read up on. Guess its over my head. I'll just keep doing the save as usual till I learn more about this macro stuff. You guys are way to smart for me :-)
Check my reply to your other post auto prompt save as when opening
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.
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.