Load macro from the command line

My Great Aunt Eleanor loves to write code that uses SolidWorks’ event handler.  ..but with all of that compiling and .dll registration she often complains “dag-gummit ” it would be easier to just write a SOLIDWORKS macro.

While it is true that macros (.swp files) can watch events. I have never seen much value in doing so – because the macro needs to be loaded to work …and I always forget to load the macro. Thus whenever I wanted to watch events, I have always just written an addin -SOLIDWORKS addins can be set to load automatically.

My buddy Jeff Cope* showed me how to load a macro via the command line at SOLIDWORKS start up.

SW Shortcut

  1. Create a shortcut to your SOLIDWORKS executable [“C:Program FilesSOLIDWORKS CorpSolidWorksSLDWORKS.exe”]
  2. Right mouse button click on your new SOLIDWORKS shortcut and select Properties.
  3. In the properties dialog for the shortcut, append the “target” property (located on the Shortcut tab) to include “/m” followed by a space then the full path to the macro in quotation marks. It should look something like this:

Command Line

Now your macro will be loaded and run when you start SOLIDWORKS, and you can watch events with a macro. Now Great Aunt Eleanor will have more time available to play Wizards of Warcraft.

*Even the mighty Engineering Data Specialist man is not above being a name dropper!

  • Share this
Find Your Design Solution in the CATI Store.
Browse Products