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


            /// <summary>
            /// 修改cui,双击填充
            /// </summary>
            ///  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;高版本填充直接弹出面板

  • 相关阅读:
    Codeforces467C George and Job
    Codeforces205E Little Elephant and Furik and RubikLittle Elephant and Furik and Rubik
    Codeforce205C Little Elephant and Interval
    51nod1829 函数
    51nod1574 排列转换
    nowcoder35B 小AA的数列
    Codeforce893E Counting Arrays
    gym101612 Consonant Fencity
    CodeForces559C Gerald and Giant Chess
    CodeForces456D A Lot of Games
  • 原文地址:https://www.cnblogs.com/JJBox/p/10640246.html
Copyright © 2020-2023  润新知