用VB連接solidworks進(jìn)行二次開(kāi)發(fā)代碼:Option Explicit
jjg[v""3| Dim swApp As Object
zCj#Nfm Dim Part As Object
}`_x%]EJ Dim D1 As Double
nO8e'&| Dim D2 As Double
xsx0ZovhY Dim D3 As Double
ohPDknHp Private Sub Command1_Click()
KK/siG~O Set swApp = CreateObject("SldWorks.Application")
?b?YiK&yz swApp.Visible (True)
Y-]Ne"+vf Set Part = swApp.OpenDoc(App.Path & "\零件1.SLDPRT", 1)
Gyy?cn6_ Set Part = swApp.ActivateDoc("零件1")
YDGW]T]i ? YvFt*t
Part.Parameter("D1@草圖1").SystemValue = Val(Text1.Text) / 1000
kp,$ NfD Part.Parameter("D2@草圖1").SystemValue = Val(Text2.Text) / 1000
^dKtUH/78G Part.Parameter("D3@草圖1").SystemValue = Val(Text3.Text) / 1000
W<Asr@