下面是我抄的部分代码,可是怎么也新建不了新的文件,单击按钮就不管用,什么反应也没有,加上断点感觉程序也是执行了这几句,但软件就是没反应) E2 c. U5 Z8 ]6 T- |3 B
/ l: H- ^ h/ D$ h h
$ B) C0 o2 [! ?) A4 H% o$ L ~, V( ^ Dim swapp As SldWorks.SldWorks w. ~' q. I/ x4 C* F+ L
Set swapp = Application.SldWorks: y2 B0 R# O! i% U* J4 s+ f
Dim swmodel As SldWorks.ModelDoc2
# G+ d% ^' |9 K4 O3 S 'Determine which option is selected. J, |. I8 O! s! V" `; J5 d6 F* F6 H
'and connect to the modeldoc2 object
L$ |! q0 p* v* J& D If optPart.Value = True Then* [- V: `$ Z# S9 j" C
Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)
' a4 Y% F. [. g$ [ End If
' I+ ~/ v7 H+ H" @+ ?4 ?0 e9 O0 Q8 P If optAssy.Value = True Then( ], o/ ]! V4 w8 \! R
Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)
' D0 O# V( K0 P$ y. ?$ N/ K* y. f End If/ a4 E1 z+ G5 R) E7 d
If optDraw.Value = True Then
$ g; p0 G8 S$ \3 ? Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)* x* t q% g; D
End If |