VB开发SolidWorks实现机械产品参数化设计

前端之家收集整理的这篇文章主要介绍了VB开发SolidWorks实现机械产品参数化设计前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Dim swapp As SldWorks.SldWorks

Dim PatFilePath As String

Dim part As SldWorks.PartDoc

Private Sub Command1_Click()

Set swapp = GetObject("D:\Program Files\SolidWorks Corp\SolidWorks\SLDWORKS.exe","SldWorks.Application")

If Err Then

Set swapp = CreateObject("SldWorks.SldWorks")

If Err Then

MsgBox ("无法创建SolidWorks")

Exit Sub

Else

swapp.Visible = True

End If

End If

swapp.Visible = True

PatFilePath = "c:\Agile\wspaces\Default\5090050031.SLDPRT "

Set part = swapp.NewDocument(PatFilePath,0#,0#)

part.SaveToFile

End Sub

原文链接:https://www.f2er.com/vb/260558.html

猜你在找的VB相关文章