下面是我抄的部分代碼,可是怎么也新建不了新的文件,單擊按鈕就不管用,什么反應也沒有,加上斷點感覺程序也是執行了這幾句,但軟件就是沒反應
. l% \' T9 U( u2 Z- \# q$ {! W3 S$ D2 X5 S+ J
" G) Q$ d: _ [- M Dim swapp As SldWorks.SldWorks
k7 z# ~! F" _9 O6 M Set swapp = Application.SldWorks- g9 b0 m8 u! ?: F9 S( |
Dim swmodel As SldWorks.ModelDoc2
1 Y8 K. I% Q R: x6 ?: h* _; ^ 'Determine which option is selected
. K- L. |0 [5 O" ~ P2 @ 'and connect to the modeldoc2 object
3 v" u% A( [) \$ P$ K5 q If optPart.Value = True Then
; A& V; y" R8 a Set swmodel = swapp.NewDocument(filedir + "APIPart.prtdot", 0, 0#, 0#); o. s- b. s+ I+ J
End If
G5 _; F3 V9 o: g If optAssy.Value = True Then: F1 l0 @& ^( h' f) r, i0 Y
Set swmodel = swapp.NewDocument(filedir + "APIassembly.asmdot", 0, 0#, 0#)3 l$ O: g# Z( E' S! h: a
End If
' ~3 N6 T# r* x If optDraw.Value = True Then8 A/ a# B: y/ b" L; ?
Set swmodel = swapp.NewDocument(filedir + "APIdrawing.drwdot", 0, 0#, 0#)
. ?6 C u8 G# a1 _+ U5 C) O1 | End If |