Dim swApp As Object
Dim Part As Object
Dim Filename As String
Dim No As Integer
Dim Title As String
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Filename = Part.GetPathName()
No = Len(Filename)
Filename = Left(Filename, No - 7)
Part.SaveAs2 Filename & ".DXF", 0, True, False
Title = Part.GetTitle
Set Part = Nothing
swApp.CloseDoc Title
X = MsgBox(" 已保存为 DXF 文件 ", 0)
End Sub