I already have a macro (which I attach as an attachment) that allows me to export a part or assembly in X_T in a "X_T FILES" subfolder.
I would need that when the "X_T FILES" folder doesn't exist, it can create one to insert the exported file into it, how should I program this?
The current program:
Sub Sauvegarde_X_T()
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Locatie As String
Dim Locatie_aangepast As String
Dim OpenDoc As Object
Dim Extensie_nieuw As String
Dim Extensie_oud As String
Dim retval As String
Dim Naam As String
Dim Naam_aangepast As String
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.ActiveDoc
Set OpenDoc = swApp.ActiveDoc()
Extensie_oud = ". SLDASM"
Extensie_nieuw = ". X_T"
Locatie = OpenDoc.GetPathName
Locatie_aangepast = Left(Locatie, Len(Locatie) - 7)
retval = Dir$(Locatie_aangepast & Extensie_oud)
Naam = Dir$(Locatie)
Naam_aangepast = Left(Naam, Len(Naam) - 7)
Titel = OpenDoc.GetTitle
Titel = Left(Titel, (Len(Titel)))
Set Part = swApp.ActiveDoc
Dim FilePath As String, FileName As String
FilePath = Left(Locatie, InStrRev(Locatie, "\"))
MsgBox FilePath & "X_T FILES" & Naam_aangepast & Extensie_nieuw
longstatus = Part.SaveAs3(FilePath & "FILES X_T\" & Naam_aangepast & Extensie_nieuw, 0, 0)
End Sub
save_x_t_-_fichiers_x_t.zip