码迷,mamicode.com
首页 > 其他好文 > 详细

双击 cui

时间:2014-06-04 18:07:37      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:des   c   class   blog   code   a   

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;
        }
    }
}

  

双击 cui,布布扣,bubuko.com

双击 cui

标签:des   c   class   blog   code   a   

原文地址:http://www.cnblogs.com/houlinbo/p/3764570.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!