I need a simple script (if it would save memory and time if its executable that's even better) that will load IGES files, do an automatic fixing of the faces if fixing is needed, and save them back as solidworks files in the same directory.
I need this to process all files in that directory, and maybe at best if some faces are not fixable, to write down the name of the iges file that has issues in a txt file.
I have a lot of files to go through so it would save me a lot of time to do this automatically.
Can anyone help me with this?
SolidworksApi macros
here ya go
excel - Loop through files in a folder using VBA? - Stack Overflow
attached is the macro.
worked on my end. Just change the directory name to where the files will be.
i took the code from the link to get the files themselves
to always use a template when opening. make sure you have Always Use these default document templates. if you don't do this, it will ask for a template every time.
i have not tested the code that retrieves the list of files but it should be fine
references are as follows
i cannot remember if they come with the macro
Thank you.
I will give it a try!
Did it work for you ?
It turned out that my version of Solidworks (I haven't kept up with the subscription since 2015 cause I don't use it that often anymore) has a broken macro editor that crashes solidworks upon running, so I can't use any of these swp scripts.
Fortunately my client said was able to automate the same process through task scheduler. So all is good!
Thank you for your help anyway!
Try using #TASK and you can create the required scripts which would not be SWP file.