下面是我抄的部分代码,可是怎么也新建不了新的文件,单击按钮就不管用,什么反应也没有,加上断点感觉程序也是执行了这几句,但软件就是没反应
% ^" T( h" X' ^0 D# Q* X) t+ k! m k# T5 B& B5 f; Y
8 n( N3 b. N7 t8 v
Dim swapp As SldWorks.SldWorks* C" S6 r- f+ q9 H
Set swapp = Application.SldWorks/ w9 X5 ^5 z2 ?: W2 H8 W
Dim swmodel As SldWorks.ModelDoc2, v7 z$ B8 I& o v* _
'Determine which option is selected5 i1 _9 ^/ X: Z; v
'and connect to the modeldoc2 object
! V) [) d1 O: Z If optPart.Value = True Then" N* h3 ]! ]5 L+ y; \
Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)
/ E2 l: K" @9 v6 n/ N1 E! c! d" H End If4 k# [" T& ~- I* x, y+ L5 g
If optAssy.Value = True Then/ R: z9 O; U; \- D
Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#), E5 }5 r: c4 F/ ]! e" z
End If+ J1 }0 b" ]6 t7 W" s. ~0 g
If optDraw.Value = True Then( w* F k# V R" D# ~
Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)# u& ^ T( ?8 E% i. ?, p5 {2 `- I! p
End If |