I found some VBA sample code in SOLIDWORKS API help , it just only for single select file.
How can make it for multi selecting ? Browsing once, and let user let select a few of files.
Public swApp As SldWorks.SldWorks
Public swModel As SldWorks.ModelDoc2
Dim Filter As String
Dim fileName As String
Dim fileConfig As String
Dim fileDispName As String
Dim fileOptions As Long
Set swApp = Application.SldWorks
' This following string has three filters associated with it; note the use
' of the | character between filters
Filter = "SolidWorks Files (*.sldprt; *.sldasm; *.slddrw)|*.sldprt;*.sldasm;*.slddrw|Filter name (*.fil)|*.fil|All Files (*.*)|*.*|"
fileName = swApp.GetOpenFileName("File to Attach", "", Filter, fileOptions, fileConfig, fileDispName)
With this we open all files from a folder and o something with it.
If you rework this a bit, it can be usefull
DXF_Folder.swp.zip 33.7 KB
I just saw this alert, glad the example helped!
If you have any questions feel free to message me.
Using functions (with Unicode) of Steve Soeder I did GUI for batch Solidworks file conversion from *.slddrw to *.pdf and from *.sldprt & *.sldasm to *.X_T files, with multiple file selection from browser or from external list.txt file (full file path at each line with quotes " " or without it) - see attached macro.
The problem is a single file selection - it gets an error (with >2 files there is no problem).
Somebody can help me to debug the problem?
SaveAs_PDF_XT.zip 50.5 KB