首页 > 其他 > 详细

双击 cui

时间:2014-06-04 18:06:38      阅读:397      评论:0      收藏:0      [点我收藏+]
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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!