You now have the power of recording your own macros for studies in SOLIDWORKS Simulation 2017. The Record button in the Macro Toolbar (or under Tools > Macro > Record) makes it quick and easy to generate the macro script automatically by following the steps you take.
What can you record in a macro?
The new SOLIDWORKS Simulation macro recording functionality is available in Static and Nonlinear Simulation studies and can capture the following tasks:
- Create studies
- Define study properties (static studies)
- Apply material
- Apply loads and boundary conditions
- Pressure, Gravity, Centrifugal, Bearing load, Temperature, Convection, Heat flux, Heat power, Radiation, Distributed mass, Uniform and selected base excitation, Fixtures, Drop test setup, Manual contact definitions (only with entity selection not automatically detected contacts), and Component contacts.
- Create Mesh and Mesh Control
- Run the study
- Create Plots
Macro recording best practice
Be aware that it records every step you take while recording. So I’d recommend preselecting the faces where you are applying a load or fixture, and then start recording and add the load/fixture. This way the next time you use the macro, you can pre-select faces from other models and run the macro. Otherwise it won’t know where to add it in a completely different model. Material application would be similar in that components in other models would be different, so you can pre-select components in the Simulation tree and run the macro to apply the recorded material.
You can also record multiple steps in a single macro. For example you could create a macro that creates a new Static study and also edits the Study Properties as needed (i.e. Direct Sparse solver with “Improve accuracy for no penetrating contacting surfaces” and “Include Global Friction” options). This way you could have multiple macros with different settings so you can quickly setup a new study based on the requirements.
In the end, macros are always created to improve efficiency and make things faster. So be sure you either create Toolbar buttons for your macros or use keyboard shortcuts to avoid having to manually search and run the .swp macro files. See my previous blog post Recording Custom Macros and Assigning Shortcuts.
SOLIDWORKS 2017 Resources
Access our resources page to get everything you need to learn what’s new in SOLIDWORKS 2017; including tech tips, demonstrations, and upcoming product webinars.