Thank you very much! I'm building my script based on that.
Maybe you could help me with a minor detail?
A part is called "XXX-XXXX".sldprt and should be saved as a step and pdf in a folder called "C:\Documents\XXX-XXX-bla bla bla"
Note the folder has the same name as the part with the exception of a random text.
How do i define the path? To be "C:\Documents\XXX-XXX-bla bla bla" when "bla bla bla" is a variable and only the name XXX-XXXX is constant.
Hope it makes sense.
You can use these codes as changes as needed.
Option Explicit Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim FileName As String Dim FilePath As String Const FolderName As String = "Test" 'Change variable here Sub Main() Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc FileName = Mid(swModel.GetPathName, InStrRev(swModel.GetPathName, "\") + 1) FileName = Left(FileName, InStrRev(FileName, ".") - 1) FilePath = "C:\Documents\" & FolderName & "-" & FileName 'Change Path as needed If Dir(FilePath, vbDirectory) = "" Then MkDir FilePath End If FilePath = FilePath & "\" Debug.Print FilePath End Sub