当前位置: 首页 > wzjs >正文

公司网站建设注意点深圳seo优化推广

公司网站建设注意点,深圳seo优化推广,黄浦品牌网站建设,市场营销网课今天给大家讲一讲solidworks中各种菜单界面,如下图,大概有13处,也许还不完整哈。 1.CommandManager选项卡2.下拉选项卡3.菜单栏4.下级菜单5.浮动工具栏6.快捷方式工具栏7.FeatureManager工具栏区域8.MontionManager区域 ModelView?9.任务窗…

今天给大家讲一讲solidworks中各种菜单界面,如下图,大概有13处,也许还不完整哈。

  • 1.CommandManager选项卡
  • 2.下拉选项卡
  • 3.菜单栏
  • 4.下级菜单
  • 5.浮动工具栏
  • 6.快捷方式工具栏
  • 7.FeatureManager工具栏区域
  • 8.MontionManager区域 ModelView?
  • 9.任务窗格
  • 10.前导视图工具栏
  • 11.定制三方工具条
  • 12.PMP界面
  • 13.右键菜单
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
我们来看一下每个方式的创建方式及核心代码:
1+3+5.
CommandManager选项卡上 + 菜单栏

  				//菜单List<int> cmdIndexs = new List<int>();//API提示的信息有误//第一个参数是菜单里面的名称//第三个参数是提示信息//第四个参数是工具条上的名称var tempCmdIndex1 = cmdGroup.AddCommandItem2("Cmd1", -1, "Cmd Tooltip1", "Cmd-1", 0, $"FunctionProxy({mainItemIds[0]})", $@"EnableFunction({mainItemIds[0]})", mainItemIds[0], menuToolbarOption);var tempCmdIndex2 = cmdGroup.AddCommandItem2("Cmd2", -1, "Cmd Tooltip2", "Cmd-2", 1, $"FunctionProxy({mainItemIds[1]})", $@"EnableFunction({mainItemIds[1]})", mainItemIds[1], menuToolbarOption);var tempCmdIndex3 = cmdGroup.AddCommandItem2("Cmd3", -1, "Cmd Tooltip3", "Cmd-3", 2, $"FunctionProxy({mainItemIds[2]})", $@"EnableFunction({mainItemIds[2]})", mainItemIds[2], menuToolbarOption);cmdIndexs.Add(tempCmdIndex1);cmdIndexs.Add(tempCmdIndex2);cmdIndexs.Add(tempCmdIndex3);cmdGroup.HasToolbar = true; //(浮动工具栏)cmdGroup.HasMenu = true;//(菜单栏)cmdGroup.Activate();//增加到工具条,是通过每个文档对象来增加的。 比如零件 装配 工程图bool bResult;foreach (int type in docTypes){CommandTab cmdTab;cmdTab = iCmdMgr.GetCommandTab(type, Title);//如果已经存在,并且id命令有变化,需要移除之后 ,重新增加。if (cmdTab != null & !getDataResult && ignorePrevious){bool res = iCmdMgr.RemoveCommandTab(TabToRemove: cmdTab);cmdTab = null;}//工具栏为空时,重新增加if (cmdTab == null){cmdTab = iCmdMgr.AddCommandTab(type, Title);CommandTabBox cmdBox = cmdTab.AddCommandTabBox();List<int> cmdIDs = new List<int>();//工具栏样式,List<int> showTextType = new List<int>();for (int i = 0; i < cmdIndexs.Count; i++){cmdIDs.Add(cmdGroup.get_CommandID(i));showTextType.Add((int)swCommandTabButtonTextDisplay_e.swCommandTabButton_TextBelow);}//把下拉式工具栏加到菜单里。cmdIDs.Add(flyGroup1.CmdID);showTextType.Add((int)swCommandTabButtonTextDisplay_e.swCommandTabButton_TextBelow);cmdIDs.Add(flyGroup2.CmdID);showTextType.Add((int)swCommandTabButtonTextDisplay_e.swCommandTabButton_TextBelow);bResult = cmdBox.AddCommands(cmdIDs.ToArray(), showTextType.ToArray());CommandTabBox cmdBox1 = cmdTab.AddCommandTabBox();//这个是加分割线,记得从后往前,因为分割后最前的id集变少了。//cmdTab.AddSeparator(cmdBox1, cmdIDs[0]);}}

在这里插入图片描述
工具栏上的下拉+快捷方式工具栏

在这里插入图片描述

FlyoutGroup flyGroup1 = iCmdMgr.CreateFlyoutGroup2(flyoutGroupID1, "FlyoutGroup1", "可下拉1", "工具栏说明",cmdGroup.MainIconList, cmdGroup.IconList, $"FlyoutCallback(6000)", "FlyoutEnable");flyGroup1.FlyoutType = (int)swCommandFlyoutStyle_e.swCommandFlyoutStyle_Simple;var addResult = flyGroup1.AddContextMenuFlyout((int)swDocumentTypes_e.swDocPART, (int)swSelectType_e.swSelFACES);FlyoutGroup flyGroup2 = iCmdMgr.CreateFlyoutGroup2(flyoutGroupID2, "FlyoutGroup2", "可下拉2", "工具栏说明2",cmdGroup.MainIconList, cmdGroup.IconList, $"FlyoutCallback(7000)", "FlyoutEnable");flyGroup2.FlyoutType = (int)swCommandFlyoutStyle_e.swCommandFlyoutStyle_Simple;public void FlyoutCallback(int gId){if (gId==flyoutGroupID1){FlyoutGroup flyGroup1 = iCmdMgr.GetFlyoutGroup(gId);flyGroup1.RemoveAllCommandItems();flyGroup1.AddCommandItem("AAA", "test", 0, $"FlyoutCommandItem1({gId+1})", $"FlyoutEnableCommandItem1({gId+1})");flyGroup1.AddCommandItem("BBB", "test", 0, $"FlyoutCommandItem1({gId+2})", $"FlyoutEnableCommandItem1({gId+2})");flyGroup1.AddCommandItem("CCC", "test", 0, $"FlyoutCommandItem1({gId+3})", $"FlyoutEnableCommandItem1({gId+3})");}if (gId == flyoutGroupID2){FlyoutGroup flyGroup2 = iCmdMgr.GetFlyoutGroup(gId);flyGroup2.RemoveAllCommandItems();flyGroup2.AddCommandItem("XXX", "test", 0, $"FlyoutCommandItem1({gId + 1})", $"FlyoutEnableCommandItem1({gId+1})");flyGroup2.AddCommandItem("YYY", "test", 0, $"FlyoutCommandItem1({gId + 2})", $"FlyoutEnableCommandItem1({gId+2})");}if (gId==7000){SwApp.SendMsgToUser("id==7000");}}

4.下级菜单

在这里插入图片描述

            var cmdGroupSub = iCmdMgr.CreateCommandGroup2(mainSubCmdGroupID, $"Addin Study\\SubMenu", ToolTip, "", -1, ignorePrevious, ref cmdGroupErr);cmdGroupSub.MainIconList = mainIcons;cmdGroupSub.IconList = icons;cmdGroupSub.AddCommandItem2($@"SubCmd4", -1, "Cmd Tooltip4", "Cmd-4", 2, $"FunctionProxy({mainItemIds[2]})", $@"EnableFunction({mainItemIds[2]})", mainItemIds[2], menuToolbarOption);cmdGroupSub.Activate();

在这里插入图片描述

    #region 工具菜单栏下面显示新菜单项var menuId = iSwApp.AddMenuItem5((int)swDocumentTypes_e.swDocPART, addinCookieID, "子菜单1@新菜单1", 0, "FlyoutCallback(7000)", "FlyoutEnable", "My menu item", icons);var menuId2 = iSwApp.AddMenuItem5((int)swDocumentTypes_e.swDocPART, addinCookieID, "子菜单3@子菜单2@新菜单1", 0, "FlyoutCallback(7000)", "FlyoutEnable", "My menu item", icons);var menuId3 = iSwApp.AddMenuItem5((int)swDocumentTypes_e.swDocPART, addinCookieID, "子菜单4@Addin Study", 0, "FlyoutCallback(7000)", "FlyoutEnable", "My menu item", icons);#endregion

8.ModelView

            IModelDoc2 pDoc;pDoc = (IModelDoc2)iSwApp.ActiveDoc;IModelViewManager swModelViewMgr;swModelViewMgr = pDoc.ModelViewManager;ModelView1Control = new UserControl1();swModelViewMgr.DisplayWindowFromHandlex64("用户控件1", ModelView1Control.Handle.ToInt64(), false);

9.任务窗格

            ITaskpaneView pTaskPanView;pTaskPanView = iSwApp.CreateTaskpaneView2("", "我的窗口");TaskPanWinFormControl = new Form1();pTaskPanView.DisplayWindowFromHandlex64(TaskPanWinFormControl.Handle.ToInt64());

10.前导视图工具栏 未找到接口
11.
在这里插入图片描述
在这里插入图片描述

 #region 新上下文菜单IFrame frame = (IFrame)SwApp.Frame();var imgPath1 = $@"{RegDllPath()}\icons\Pic1 (1).png";var imgPath2 = $@"{RegDllPath()}\icons\Pic1 (2).png";var imgPath3 = $@"{RegDllPath()}\icons\Pic1 (3).png";var imgPath4 = $@"{RegDllPath()}\icons\Pic1 (4).png";var imgPath5 = $@"{RegDllPath()}\icons\Pic1 (5).png";var imgPath6 = $@"{RegDllPath()}\icons\Pic1 (6).png";var resultCode = frame.AddMenuPopupIcon2((int)swDocumentTypes_e.swDocPART, (int)swSelectType_e.swSelNOTHING, "新上下文菜单", addinCookieID, "PopupCallbackFunction", "PopupEnable", "", imgPath1);// create and register the third party menu 创建并注册第三方组菜单registerID = SwApp.RegisterThirdPartyPopupMenu();// add a menu break at the top of the menu  在组菜单最上方增加一个不能点击的菜单resultCode = SwApp.AddItemToThirdPartyPopupMenu2(registerID, (int)swDocumentTypes_e.swDocPART, "我的菜单", addinCookieID, "", "", "", "", "", (int)swMenuItemType_e.swMenuItemType_Break);// add a couple of items to to the menu   增加菜单内的命令集resultCode = SwApp.AddItemToThirdPartyPopupMenu2(registerID, (int)swDocumentTypes_e.swDocPART, "命令测试1", addinCookieID, "FlyoutCallback(7000)", "FlyoutEnable", "", "Test1", imgPath2, (int)swMenuItemType_e.swMenuItemType_Default);resultCode = SwApp.AddItemToThirdPartyPopupMenu2(registerID, (int)swDocumentTypes_e.swDocPART, "命令测试2", addinCookieID, "FlyoutCallback(7000)", "FlyoutEnable", "", "Test4", imgPath3, (int)swMenuItemType_e.swMenuItemType_Default);// add a separator bar to the menu  增加分割线resultCode = SwApp.AddItemToThirdPartyPopupMenu2(registerID, (int)swDocumentTypes_e.swDocPART, "", addinCookieID, "", "", "", "", "", (int)swMenuItemType_e.swMenuItemType_Separator);//继续增加个命令resultCode = SwApp.AddItemToThirdPartyPopupMenu2(registerID, (int)swDocumentTypes_e.swDocPART, "命令测试3", addinCookieID, "FlyoutCallback(7000)", "FlyoutEnable", "", "Test5", imgPath4, (int)swMenuItemType_e.swMenuItemType_Default);// add an icon to the menu bar  给菜单条上面再加图标按钮resultCode = SwApp.AddItemToThirdPartyPopupMenu2(registerID, (int)swDocumentTypes_e.swDocPART, "", addinCookieID, "FlyoutCallback(7000)", "FlyoutEnable", "", "NoOp", imgPath5, (int)swMenuItemType_e.swMenuItemType_Default);#endregion
  1. PMP界面–请参考插件里的CreatePropertyManagerPage
  2. 对象的右键菜单
    在这里插入图片描述
  #region 右键菜单//右键菜单 (好像没看到图标的定义方式)  --选中草后 右键显示var popItem1 = SwApp.AddMenuPopupItem4((int)swDocumentTypes_e.swDocPART, addinCookieID, "ProfileFeature", "右键菜单","FlyoutCallback(7000)", "FlyoutEnable", "我的右键菜单", "");SwApp.AddMenuPopupItem4((int)swDocumentTypes_e.swDocPART, addinCookieID, "ProfileFeature", "子菜单For草图@右键子菜单","FlyoutCallback(7000)", "FlyoutEnable", "子菜单@右键菜单", "");#endregion

上面是我收集的到一些关于solidworks中二次开发里常用的一些增加自己的菜单或者命令的办法,当然也可能不是太准确。希望对大家有帮助。
代码还是保持开源风格,各位家人们自取
在这里插入图片描述

https://gitee.com/painezeng/SolidWorksAddinStudy

http://www.dtcms.com/wzjs/461646.html

相关文章:

  • 怎样做网站制作做营销型网站的公司
  • 网站新闻不收录哪些广告平台留号码
  • 最近在线观看免费完整版高清韩剧唐山seo排名外包
  • 宁波做网站设计灰色词排名接单
  • 公众号建网站整合营销传播方案案例
  • 怎样做网络销售网站百度前三推广
  • 网站修改思路四平网络推广
  • 邯郸营销型网站解析域名网站
  • 如何做网站 优帮云什么是网络推广营销
  • 山东省济宁市最新消息广东seo推广哪里好
  • 如何用自家电脑做网站服务器什么推广方法是有效果的
  • wordpress标题代码调用武汉seo招聘
  • 网站做的一样算侵权吗重庆百度快速优化
  • 做一家网站费用吗小程序开发需要哪些技术
  • php做网站需要什么技术深圳关键词排名推广
  • 概念网站源码网站设计制作
  • 如何不花钱建设网站重庆网站seo诊断
  • 辽源网站建设公司网页制作素材模板
  • 焊枪公司网站怎么做互联网推广运营
  • 关于苏宁易购网站建设的不足之处网络营销pdf
  • 做动态网站需要什么书上海网站快速排名提升
  • 做国外贸易的网站seo权重优化
  • 推广联盟网站怎么做seo排名软件价格
  • 哪家做网站性价比高dw网页制作详细步骤
  • 网站建设找汉狮营销方案怎么写模板
  • 资讯类网站怎么做营销渠道模式有哪些
  • 网站怎么做图片动态图片不显示了seo前景
  • 汉口网站建设制作自己手机怎么免费做网站
  • 网站 开发 合同广东广州疫情最新情况
  • wordpress增加登录账户优化加速