下面是我抄的部分代碼,可是怎么也新建不了新的文件,單擊按鈕就不管用,什么反應也沒有,加上斷點感覺程序也是執行了這幾句,但軟件就是沒反應4 ^- Q8 ~7 w! {9 L
0 A1 x0 S& Y1 P, V# C# T5 a
: P4 G, v+ z0 i* V4 }+ K! C, v Dim swapp As SldWorks.SldWorks
! S) {2 K0 D; @6 ~+ ~+ e3 P) u Set swapp = Application.SldWorks
; C' y: B1 |9 e5 h# Q! S- @ Dim swmodel As SldWorks.ModelDoc2
5 f" t" q/ ]3 u, J- q, I1 w! D 'Determine which option is selected! d# u: U* f% Z. s
'and connect to the modeldoc2 object' p j3 k) O) d! S9 J, P' U
If optPart.Value = True Then
# C! K4 n$ e% u* k' R1 ~9 | Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)) u4 Q) P) r3 U( m2 b1 D1 c6 n
End If
$ v1 p3 E- P9 `3 a If optAssy.Value = True Then
4 ~+ S6 V# R2 ~6 r Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)3 m) V3 w4 j2 @3 s- J& g2 R0 C
End If
- e7 \5 ~. a+ b' p% d: D$ B7 d$ ]+ C If optDraw.Value = True Then7 b! n! X- S' O1 ~8 u
Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)$ M8 }5 G6 C7 e- |* N( h2 [3 v
End If |