下面是我抄的部分代码,可是怎么也新建不了新的文件,单击按钮就不管用,什么反应也没有,加上断点感觉程序也是执行了这几句,但软件就是没反应8 y1 L: e+ @+ E) H4 l
: r; j+ s" v/ \1 y! S7 v7 k
, S$ R) A9 e7 T- u1 |! F2 C7 y: `* ?
Dim swapp As SldWorks.SldWorks
. e2 d _' ?! r0 t) W) m! x6 ~ Set swapp = Application.SldWorks
, |. ^7 s7 ^! V$ d Dim swmodel As SldWorks.ModelDoc2
3 ?/ j3 S' h* d4 |/ f( m 'Determine which option is selected+ p9 b9 X& [+ }$ W! ^0 c7 I
'and connect to the modeldoc2 object
. J9 ?, {8 c* w4 { If optPart.Value = True Then
. ^& }9 [) @$ l5 H2 t$ f1 z; e Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)$ [4 N, W' {* s Y" z a8 A7 d
End If
5 W; c& M* s9 M9 N+ j If optAssy.Value = True Then
3 M4 @$ ~( ]( a Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)
" j6 G/ L3 \+ v End If
$ t9 e# ~ t/ z2 O If optDraw.Value = True Then
& X1 B# A7 p2 ~9 K0 Q& q- V Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)
/ m* l2 V3 i0 o) {7 r& C, L) ? End If |