我复制的宏代码运行错误!!!跪求个SOLEDWORKS转DWG的宏文件,
错误的地方在下面红色地方,所以我求个SOLEDWORKS转DWG的宏文件,不要代码了,呵呵。有的传个给我,谢谢!
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 & ".DWG", 0, True, False
Title = Part.GetTitle
Set Part = Nothing
swApp.CloseDoc Title
X = MsgBox(" 已保存为 DWG 文件 ", 0)
End Sub