When working within SOLIDWORKS, there are a lot of processes that can become repetitive and take quite a long time to complete and most of us see if there’s a way to streamline the process and reduce time. Lucky for us, there are three ways that this can be done with:
- SOLIDWORKS Macros
- SOLIDWORKS Add-ins
Let’s look a little deeper into each of the three methods above:
Macros are most commonly used within the SOLIDWORKS interface which means that an instance of SOLIDWORKS must be running for this code to be run. Macros are most commonly coded in VBA (Visual Basic for Application), similar to the syntax used for VB.net.
An example would be if you had a drawing file (.SLDDRW) open in SOLIDWORKS and would like to save it as a PDF, you would create a macro from the Tools > Macro > New menu and place the code found in the article SOLIDWORKS VBA Macro Code to Save Drawing as a PDF and run it through the .SOLIDWORKS interface.
A SOLIDWORKS macro is essentially a shortcut to a task performed repeatedly in SOLIDWORKS, such as adding specific items to custom properties, changing image qualities prior to closing a working document, opening default templates etc. You can also record or build a macro in SOLIDWORKS and play it back to repeat the commands — however, keep in mind that this may not always work as intended as some actions through the user interface are difficult for the recording tool to capture.
Add-ins for SOLIDWORKS will be created outside of the SOLIDWORKS interface, most commonly through the Visual Studio Platform. This Add-in will typically show on the ribbon menu when SOLIDWORKS is launched. After creating the add-in and compiling it using the .net platforms, you are required to load that add-ins DLL in the SOLIDWORKS interface and enable it through Tools > Add-ins like you would do any other SOLIDWORKS add-ins including Routing, PDM, Electrical etc.
If you use SOLIDWORKS PDM, you can create a SOLIDWORKS PDM Add-in which will be added to the Administration tool to run when certain commands are executed within the Vault, similar to the SOLIDWORKS Task Add-in and Dispatch Add-in.
Add-ins can have multiple “buttons” (functions) to run different commands in one ribbon, allowing for better integration and clarity within the software
Executable is an application that can be written in a Visual Studio platform and run outside of SOLIDWORKS and SOLIDWORKS PDM. With the right DLL file references, it will be able to access commands within SOLIDWORKS and PDM allowing you the ability to work with altering multiple files within a folder, changing their properties and updating file references using the document manager API. For PDM user’s this is similar to how the File Version Upgrade Utility was created, it’s a PDM Executable, that runs outside of PDM and SOLIDWORKS that goes in and updates the file references using certain parameters.
Learn more about SOLIDWORKS Macros/API
Macros, Add-ins and Executables are a great way to streamline your process and help organize your workflow. you can learn more about how to create these on SOLIDWORKS API Help as well as the training Javelin provides, SOLIDWORKS VB for Applications and SOLIDWORKS API training courses, which you can take live online, or in one of our Canadian classrooms. Check our schedule to learn more.
Get Certified SOLIDWORKS Services from Javelin
Javelin Experts can help you to: