I created a macro allowing me to successively launch a statistical study of my assembly by changing the point of application of the force. I isolate the resulting displacement (URES) in a Variant variable using the function: GetDisplacementForEntities (see the link: http://help.solidworks.com/2014/English/api/swsimulationapi/SolidWorks.Interop.cosworks~SolidWorks.Interop.cosworks.ICWResults~GetDisplacementForEntities.html).
I then want to save this result before launching my new simuation. However, the other backup functions of the Solidworks API seem to concern assembly, part or drawing files (see the save3 and saveas functions).
Does anyone know of a way to save the result of a study?
Thank you for your answers even if for the moment it doesn't solve my problem. The report is too general because I want to automatically isolate the URES displacement.
I feel like my current code is doing the hardest because it isolates the URES move and the stock in a variable, the question is: is it possible to save the contents of an object variable?
Yes, it is quite possible to save the variable in a text or CSV file (which can be opened with Excel) with VBA instructions:
'###### for the text file f = FreeFile Open "c:/test.csv" For Append As #f open CSV or TXT file Writing to the properties file Print #f, "1; 1st result; " & RESUL1 Print #f, "2; 2nd result; " & RESUL2 Close #f
Thank you .PL for your answer, the problem remains the same, the print function only accepts variables such as assembly, part or drawing or I want to save only the result of the simu...