下面是我抄的部分代码,可是怎么也新建不了新的文件,单击按钮就不管用,什么反应也没有,加上断点感觉程序也是执行了这几句,但软件就是没反应4 E# O7 d9 {7 z4 H+ h! l3 s I
8 F2 `: x; J8 c- d! C d: D+ v, o- \
4 w& }+ W1 h2 M' V
Dim swapp As SldWorks.SldWorks7 w( r# z7 [8 I6 J0 P0 n; e
Set swapp = Application.SldWorks
1 _4 `* F4 @5 j- E( W Dim swmodel As SldWorks.ModelDoc2
( e" Y- |$ @0 m: q# W 'Determine which option is selected
$ v8 |6 K$ o0 a- X" ~9 f 'and connect to the modeldoc2 object
; J+ S/ ] ~6 O9 o If optPart.Value = True Then
$ n P9 ?8 z9 \9 D8 r Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)
& [3 F; A* T3 j% I End If
# d, p9 U: m$ p+ X0 c' b/ [, u2 z! R7 B If optAssy.Value = True Then! O1 Y: J9 K' j& k) u8 g3 V$ o R
Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)
% `; d+ ~' L; M# l5 ~ End If
( a0 }- p q0 o+ k6 E( f$ b6 q If optDraw.Value = True Then5 x/ U0 r! y8 w* }/ F! r4 S
Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)2 s: S' W$ }1 A2 y/ H6 c
End If |