用vb二次开发sw时,重新生成零件图时总是弹出错误:“对象变量或with块变量未设置”
而同样的方法有的零件就可以有的就不行,好象是旋转体就可以拉伸是不可以,不知道为什么!各位高手有谁知道这是怎么回事?请指教,谢谢!
程序大概如下:swapp,part,l0...这些变量都已经定义。
Private Sub Command1_Click()
Set swapp = CreateObject("sldworks.application")
swapp.Visible (True)
Set part = swapp.OpenDoc(App.Path & "\A型\2孔.sldprt", 1)
Set part = swapp.ActivateDoc("art1")
part.Parameter("d1@草图1").SystemValue = l0/1000
....................
....................
part.EditRebuild
part.EditRebuild
End Sub
把这些都定义一次看看能解决么"
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long
Dim Annotation As Object
Dim Gtol As Object
Dim DatumTag As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object"
要定义在public内