Anyone knows how to detect the corrupted SOLIDWORKS file (in a folder) via API?
My goal is open each files in a folder and generate a log file to indicate corrupted files.
You can use #TASK with any empty macro. So it just tries to open the model and display the error if it is failed.
For example (I have also attached this script):
Sub main()End Sub
Just select the version of SolidWorks you want to check against in the drop down in the header.
You may move the mouse over the red cross icon to see the details of error.
I would also suggest to check the following options to increase the performance:
Hi Artem Taturevych
I have the same question.
I would like to know how I can detect that the assembly is corrupt using C# code.
this line crashes solidworks.
assemblyDoc is a sub assembly
comp = assemblyDoc.GetComponentByName(name) as Component2
giving this line inside try..catch.. does not help.
Retrieving data ...