I want to automate taking snips of FEA results for reports and record keeping. I am trying to save as a PNG with the file name changing to match the Simulation Study name and the type of result I am looking at: Stress, Displacement, or Factor of Safety. I have the code to save a PNG in a designated location but I do not know how to query the name of the study or results through the macro.
I have the save as PNG macro working and I just need the code to pull the simulation and results names so I can tag it onto the end of the save as naming code.
To get a Solidworks Simulation Name use the
NameProperty (ICWStudy) as documented here.To get acess the study results use the
ResultsProperty (ICWStudy) as documented here.Bellow you can find VBA code.
Tested it in a part document with only one study called
Test Studyand it get correctly printed the name and the stress results to immediate window.Make sure you set reference to Solidworks Simulation 20## type library. It's not default.