马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
本人大学狗,接触SOLIDWORKS没多久,现在被老师逼得硬着头皮搞二次开发,最近碰到一个问题,望各位大神指点一下,再用VB编写DLLsolidworks插件的时候,编译出来的插件不能被运行,下面附上代码:
Implements SWPublished.SwAddin
Dim iSldWorks As SldWorks.SldWorks
Dim iCookie As Long
Private Function SwAddin_ConnectToSW(ByVal ThisSW As Object, ByVal Cookie As Long) As Boolean
Dim bRet As Boolean
Set iSldWorks = ThisSW
iCookie = Cookie
bRet = iSldWorks.SetAddinCallbackInfo(App.hInstance, Me, iCookie)
bRet = iSldWorks.AddMenu(swDocNONE + swDocPART, "标准件(&L)", 3)
bRet = iSldWorks.AddMenuItem2(swDocNONE + swDocPART, iCookie, "简易的螺栓标准库(&S)@标准件(&L)", -1, "简易螺栓标准库", "ItemUpdate", "弹出简易螺栓标准件窗口")
SwAddin_ConnectToSW = True
End Function
Private Function SwAddin_DisconnectFromSW() As Boolean
Dim bRet As Boolean
bRet = iSldWorks.RemoveMenu(swDocNONE + swDocPART, "标准件(&G)", "")
Set iSldWorks = Nothing
SwAddin_DisconnectFromSW = True
End Function
Public Sub 简易螺栓标准库()
Shell App.Path & "\初步尝试1.0.exe"
MsgBox "选择的菜单为螺栓标准件!"
End Sub
Public Function ItemUpdate() As Long
ItemUpdate = 1
End Function
部件 引用绝对没有问题的!望大神在闲暇之余瞅瞅,谢谢
|