Does anyone have a macro that will go through a folder and open each parasolid file and then save it as a solidworks file?
SolidworksApi macros
Does anyone have a macro that will go through a folder and open each parasolid file and then save it as a solidworks file?
SolidworksApi macros
Using codes for import from this macro
Import Models as Solids Example (VBA)
or
Import STEP File Example (VBA)
and batch open files from this macro Batch File Open and Save
make the macro as required.
I don't have SolidWorks in front of me otherwise I would have been happy to make the macro.
I do not know enough to modify macros, I need something that already works.
I did made once a similar macro for my use but could not locate it right now
May be someone else should be able to help you as it is not much difficult to set the macro.
Also check if http://www.batchprocess.co.uk/ helps to do the same job.
I recored a macro to open one and save it but I do not know how to make loop and open each file and save it as a solidworks file.
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = _
Application.SldWorks
boolstatus = swApp.LoadFile2("G:\Tooling\B.0864.06\Complete Die\Bottom\B.0864.06.001.x_t", "")
Set Part = swApp.ActiveDoc
Dim myModelView As Object
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
Dim activeModelView As Object
Set activeModelView = Part.ActiveView
activeModelView.DisplayMode = swViewDisplayMode_e.swViewDisplayMode_ShadedWithEdges
longstatus = Part.SaveAs3("G:\Tooling\B.0864.06\Complete Die\Bottom\B.0864.06.001.SLDPRT", 0, 2)
End Sub
You just need to mix these codes with Batch Open and save macro above. If you can open the batch open and save macro and paste the codes here or in a notepad and attach here, I should be able to fix the macro.
Try the attached one.
Worked Great!! Thanks.
Hello Deepak,
Finally I've found exactly what I was looking for and have just downloaded the macro.
Unfortunately, I've received the "can't open ....swp file" message when tried to open\edit it in SolidWorks 2012.
The same is with the original macro you've mentioned earlier in this post.
Is there a chance to fix it or to paste the code to a txt file?
Thank you in advance,
Alex
Alex, any chance you have SW2013 beta installed, then that might be a reason for the issue.
Anyhow attached is the macro in text file and bas file you would for browse function.
Hello again,
I've managed to open the macros. I have SolidWorks 2013 beta3 installed on the same machine. There was no problem to edit the macros. May be the possible cause of the problem is that in 2013 version SolidWorks moved to VBA7, while all previous version till 2012 are using VBA6?
Thanks,
Alex
Thank you, again
(we were probably writing almost at the same time and I didn't see you've already answered).