下面是我抄的部分代码,可是怎么也新建不了新的文件,单击按钮就不管用,什么反应也没有,加上断点感觉程序也是执行了这几句,但软件就是没反应* E) h) A5 g- T# y& u+ {1 ^: A
2 H* V+ ^ C% J0 h: |
0 G+ W1 V. K8 M; g8 V; h( g& _
Dim swapp As SldWorks.SldWorks
% b% Z5 ]' \& }# r" P+ Q Set swapp = Application.SldWorks
/ K; W+ X. d: O. w4 n$ i( \ Dim swmodel As SldWorks.ModelDoc23 C; l0 G3 u" W# n5 A' O( v
'Determine which option is selected
5 f* d2 [- U, U6 ?$ R 'and connect to the modeldoc2 object
1 t3 k' ^7 q6 V1 J8 z; ~ If optPart.Value = True Then
( S8 O( ^' p# ~( i Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#)$ ]! X9 Z2 k" T6 Y+ `
End If
, u: P. N# }0 _5 z If optAssy.Value = True Then& S, H& h f2 C9 M$ r- }# u3 S
Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)
1 X4 t7 B8 f: a) Q ?6 w! z End If; R" q& a$ L5 v) x) \
If optDraw.Value = True Then
& B& i: K# o* c: S* J; l Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)2 i2 J) P9 \1 R F+ w0 A
End If |