cad.net 更改高版本填充交互方式为低版本样子

        /// 
        /// 修改cui,双击填充
        /// 
        ///  https://blog.csdn.net/hfmwu/article/details/84139169 
        ///  https://adndevblog.typepad.com/autocad/2012/12/customizing-double-click-on-block-reference.html
        public static void RegeditDoubleClickEvent()
        {
#if !HC2019
            try
            {
                //检索ACAD CUI文件的位置,然后打开它 
                string mainCuiFile = Getvar("MENUNAME");                
                if (File.Exists(mainCuiFile + ".cui"))
                {
                    mainCuiFile += ".cui";
                }
                else if (File.Exists(mainCuiFile + ".cuix"))
                {
                    mainCuiFile += ".cuix";
                }

                var cs = new CustomizationSection(mainCuiFile);
                DoubleClickAction blockDoubleClickAction = null;
                foreach (DoubleClickAction dca in cs.MenuGroup.DoubleClickActions)//要加入accui.dll 浩辰没有
                {
                    //英文版CAD使用英文名称,具体对象名称可在CAD自定义面板内查询
                    if (dca.Name.Equals("图案填充"))
                    {
                        blockDoubleClickAction = dca;
                        break;
                    }
                }
                if (blockDoubleClickAction != null)
                {
                    //更改双击宏以调用我们的命令 
                    var ma = blockDoubleClickAction.DoubleClickCmd.MenuMacroReference.macro;
                    const string str = "编辑图案填充";
                    if (!ma.Name.Contains(str))
                    {
#if !AC2008
                        ma.CLICommand = "HATCHEDIT";
#endif
                        ma.Command = "^C^C_hatchedit";
                        ma.Name = str;
                        ma.HelpString = "修改现有的图案填充对象:   HATCHEDIT";

                        // 保存我们的更改
                        if (cs.IsModified)
                        {
                            cs.Save();
                        }
                    }
                }
            }
            catch (System.Exception e)
            {
                throw e;
            }
#endif
        }

 

  

修改完这个之后,要修改 

HPDLGMODE,1;高版本填充直接弹出面板

你可能感兴趣的:(cad.net 更改高版本填充交互方式为低版本样子)