'~~~~~~~~~~~~~~~~~~~~~~
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc
Dim Part As Object
Dim sFileName As String
Dim nFileName As String
Dim path As String
Dim nPath As String
Dim nErrors As Long
Dim nWarnings As Long
Dim Code_Vaule As String
Sub main()
Set swApp = Application.SldWorks
path = InputBox("输入含有焊件轮廓模板的文件夹路径 (For example '' D:\sw\GB焊件轮廓库\ '' )", "输入文件夹路径") '键入存档路径
sFileName = Dir(path & "*.SLDLFP") '取出档名 *.SLDLFP
Do Until sFileName = ""
Set swModel = swApp.OpenDoc6(path + sFileName, swDocPART, swOpenDocOptions_Silent, "", nErrors, nWarnings) '开档 SLDLFP
Set Part = swApp.ActiveDoc