zoukankan      html  css  js  c++  java
  • AutoCAD.net: DoubleClick

    Double clicking on most objects in the drawing window displays the Properties palette. This behavior can be changed with the DoubleClickAction and DoubleClickCmd classes. Use this to add behavior to custom objects as well.

    To edit the double-click behavior, first attach a MacroId to a DoubleClickCmd object. This defines the action that will be performed. Next, attach a DoubleClickAction to a drawing object using the DxfName() property. Finally attach the action to the command.

     

                string acadCui = (string)Application.GetSystemVariable("MENUNAME") + ".cui"; //Get mainCuiFile

                acadCui = acadCui.ToLower();

                CustomizationSection cs0 = new CustomizationSection(acadCui);

                string customCui = acadCui.Replace("acad.cui", "custom.cui"); //Get partialCui

                CustomizationSection custom = new CustomizationSection(customCui);

     

                DoubleClickAction dblClickAction = new DoubleClickAction(custom.MenuGroup, "My Double click", -1);

                dblClickAction.DxfName = "Polyline";

                DoubleClickCmd dblClickCmd = new DoubleClickCmd(dblClickAction);

                dblClickCmd.MacroID = "MM_1567";

                dblClickAction.DoubleClickCmd = dblClickCmd;

     

                /*dblClickAction is now set to execute the polyline edit macro (MM_1567) when a Polyline is double-clicked.

                 * If a double-click action for an object is overridden, the new action takes precedence,

                 * and the old action becomes inactive.

                 */

  • 相关阅读:
    时间选择器UIDatePicker的使用
    在app中屏蔽第三方键盘
    plist文件的相关操作
    查看mac上的隐藏文件
    设置ARC有效或者无效
    Linux 下源代码安装编译 ImageMagick6.8.48 且使其支持 JPEG
    Linux Netcat 命令—网络工具中的瑞士军刀
    Linux 好书、经典书籍推荐
    让你拥有超能力:程序员应该掌握的统计学公式
    shell 脚本实现的守护进程
  • 原文地址:https://www.cnblogs.com/wf225/p/1277347.html
Copyright © 2011-2022 走看看