I have made a macro, but I'm not able to give the filename in VB. The file needs to be saved as follows:
longstatus = Part.SaveAs3("K:\\temp\\"file name of the part or assembly".X_T", 0, 0)
How to retrief the file name? Please add the code in the VB cript displayed beneath.
------Macro start -------
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
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("Top Plane", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Top Plane", "PLANE", 0, 0, 0, False, 8, Nothing, 0)
boolstatus = Part.InsertCoordinateSystem(False, False, False)
longstatus = Part.SaveAs3("K:\\alg\\Specialisatie\\Standardisatie\\K0005 Folie voor in de cleanroom\\TPD\\Encapsulating sheet A4.X_T", 0, 0)
Part.ClearSelection2 True
End Sub
------Macro end -------
SolidworksApi macros