Solidworks二次开发平台 --- RyS.SwWorks [2015-09-18更新]

RyS.SwWorks 是一款基于.NET的Solidworks二次开发平台,该平台封装了插件注册、菜单、工具栏、侧边栏、Document接口,使得Solidworks开发和部署简单高效。

安装程序中自带开发示例程序。 并且提供一套模拟调试工具,使得Solidworks二次开发和调试更简单方便。

RyS.SwWorks3.5下载地址

代码示例:

//添加菜单 SwWorksApp.MenuMgr.AddMenuItem(new swDocumentTypes_e[] { swDocumentTypes_e.swDocNONE, swDocumentTypes_e.swDocPART, swDocumentTypes_e.swDocASSEMBLY, swDocumentTypes_e.swDocDRAWING }, "CreateCube@MyUserAddin1", "Create Cube", "\\sources\\images\\icons\\mark.bmp", OnCreateCube, OnCreateCubeEnable);
SwWorksApp.MenuMgr.AddMenuSeparator(new swDocumentTypes_e[] { swDocumentTypes_e.swDocNONE, swDocumentTypes_e.swDocPART, swDocumentTypes_e.swDocASSEMBLY, swDocumentTypes_e.swDocDRAWING },  "@MyUserAddin1");//分隔符
SwWorksApp.MenuMgr.AddMenuItem(new swDocumentTypes_e[] { swDocumentTypes_e.swDocNONE, swDocumentTypes_e.swDocPART, swDocumentTypes_e.swDocASSEMBLY, swDocumentTypes_e.swDocDRAWING },  "About@MyUserAddin1", "MyUserAddin1 About", "\\sources\\images\\icons\\about.bmp", OnAbout, null);




//添加工具栏
ISwToolBar toolbar = SwWorksApp.AddToolBar("MyUserAddin1", "MyUserAddin1 Tip", "MyUserAddin1 Hint");
if (toolbar != null) {    ISwToolBarGroup group1 = toolbar.AddToolBarGroup("group1", new swDocumentTypes_e[] { swDocumentTypes_e.swDocNONE, swDocumentTypes_e.swDocPART, swDocumentTypes_e.swDocASSEMBLY, swDocumentTypes_e.swDocDRAWING });    group1.AddBarItem("CreateCube", "Create Cube", "Create Cube", "\\sources\\images\\icons\\mark.bmp", OnCreateCube, OnCreateCubeEnable);    group1.AddBarItem("About", "About", "About", "\\sources\\images\\icons\\about.bmp", OnAbout, null);    toolbar.EndUpdate(); }


 //添加侧边栏
 _myUC = new MyUserControl1(this);
 SwWorksApp.AddTaskPaneView("MyUserAddin1", "\\sources\\images\\icons\\field_public.png", _myUC); 


注册插件的方法有2种:注册表和手工加载
//注册表:可以通过手工运行插件相应的.reg文件或者程序自动写入注册信息
[HKEY_CLASSES_ROOT\Software\RySoft\Rys.SwWorks\Addins\MyUserAddin1]

 

//手工加载:在SwWorks的插件管理器中手工选择要加载的插件文件

 

具体详细请查看安装程序中示例项目MyUserAddin1(\samples\MyUserAddin1\)

 

转载于:https://www.cnblogs.com/RySoft/p/SwWorks.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值