下面是我抄的部分代码,可是怎么也新建不了新的文件,单击按钮就不管用,什么反应也没有,加上断点感觉程序也是执行了这几句,但软件就是没反应) c/ K# ]! J0 C ^7 J7 n
. n% U5 P3 C! M' l7 y& X: x0 D" m! ~6 j( n
Dim swapp As SldWorks.SldWorks
6 i# J: f+ `- z! S. } Set swapp = Application.SldWorks
) W. Q/ |, O3 z: e* S Dim swmodel As SldWorks.ModelDoc2) k: V- G$ H; W6 d* I0 [/ u3 U. D: j
'Determine which option is selected1 N# f+ b" F/ O+ e7 h) X; J& n
'and connect to the modeldoc2 object* _, }; m. R* M
If optPart.Value = True Then
9 w- N) R9 m) } G$ X' f6 O Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)8 M* R) F7 O/ y/ M, j
End If- A S( z+ G7 ?# J2 c& f
If optAssy.Value = True Then% W, j3 v& _ f
Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)
* _( L, n \5 C6 G6 ` End If
; j0 t* i C \2 X If optDraw.Value = True Then
5 L3 q# I* | {4 L* N Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)
( I+ l! q/ m3 [, Z) t End If |