首页 > 代码库 > 双击 cui
双击 cui
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | //改变属性块的双击事件 //将菜单文件中的双击改一下,退出时还原文件 acad.bak.cui 改这个名字 每次用这个更新为新的 acad.cui进行修改 //退出时再用 acad.bak.cui还原acad.cui public static void ChangeCuiForDoubleChick( string cmd) { string cuiPath = @"C:\Documents and Settings\Administrator\Application Data\Autodesk\AutoCAD 2007\R17.0\chs\Support\acad.cui" ; Autodesk.AutoCAD.Customization.CustomizationSection cs = new CustomizationSection(cuiPath, "ACAD" ); ; string mgName = "HoulinboMenuGroups" ; //宏组 string mmName = "HoulinboDblblockMacro" ; //宏 string command = cmd; //对应属性块编辑查看宏命令 string dblclickEID = "ID_VFHoulinboForDoubleChick" ; //菜单宏 MenuMacro oMenuMacro1 = cs.FindMenuMacro(mmName); if (oMenuMacro1 == null ) { //先自定义宏组 MacroGroup oMacroGroup = cs.MenuGroup.FindMacroGroup(mgName); if (oMacroGroup == null ) oMacroGroup = new MacroGroup(mgName, cs.MenuGroup); oMenuMacro1 = new MenuMacro(oMacroGroup, mmName, command, dblclickEID, MacroType.Any); } foreach (DoubleClickAction dc in cs.MenuGroup.DoubleClickActions) { if (dc.DxfName.Equals( "ATTBLOCKREF" )) { dc.DoubleClickCmd.MacroID = dblclickEID; cs.SaveAs(cuiPath); return ; } } } |
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。