基于VB的solidworks二次开发,dll插件开发
OptionExplicitImplementsSWPublished.SwAddinDimswAppAsSldWorks.SldWorksDimswModelAsSld...
Option Explicit
Implements SWPublished.SwAddin
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swCookie As Long
Dim swToolbarID As Long
Private Function SwAddin_ConnectTosw(ByVal ThisSw As Object, ByVal Cookie As Long) As Boolean
Set swApp = ThisSw
swCookie = Cookie
swApp.SetAddinCallbackInfo App.hInstance, Me, swCookie
swApp.AddMenu swDocPART, "螺纹联结标准件库", 5
swApp.AddMenuItem2 swDocPART, swCookie, "螺纹联结标准件库@启动", 1, "Block_MenuCallback", ","
End Function
Public Sub Block_MenuCallback()
Shell App.Path & "\螺纹联结标准件库.exe"
Exit Sub
End Sub
Private Function SwAppin_DisconnectFromSW() As Boolean
swApp.removemenu swdocrart, "螺纹联结标准件库", ""
End Function
请问各位大大,为什么编译时会说用户定义类型未定义,应该引用相关类型已经引用,小弟分不多,希望大大们见谅
编译报错的地方为
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
希望对各位大大有帮助,不胜感激
我的solidworks版本是2006的,但是用的API教程是2004版的,您的意思是因为版本不同所以相应函数出现了变化么? 展开
Implements SWPublished.SwAddin
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swCookie As Long
Dim swToolbarID As Long
Private Function SwAddin_ConnectTosw(ByVal ThisSw As Object, ByVal Cookie As Long) As Boolean
Set swApp = ThisSw
swCookie = Cookie
swApp.SetAddinCallbackInfo App.hInstance, Me, swCookie
swApp.AddMenu swDocPART, "螺纹联结标准件库", 5
swApp.AddMenuItem2 swDocPART, swCookie, "螺纹联结标准件库@启动", 1, "Block_MenuCallback", ","
End Function
Public Sub Block_MenuCallback()
Shell App.Path & "\螺纹联结标准件库.exe"
Exit Sub
End Sub
Private Function SwAppin_DisconnectFromSW() As Boolean
swApp.removemenu swdocrart, "螺纹联结标准件库", ""
End Function
请问各位大大,为什么编译时会说用户定义类型未定义,应该引用相关类型已经引用,小弟分不多,希望大大们见谅
编译报错的地方为
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
希望对各位大大有帮助,不胜感激
我的solidworks版本是2006的,但是用的API教程是2004版的,您的意思是因为版本不同所以相应函数出现了变化么? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询