//替换CAD中原有命令为开发人员自己开发的命令的方法
        //在CAD中执行一次RegisterMyCommand命令后,再执行line时就会loadhead程序了
        [CommandMethod("RegisterMyCommand")]
        public void RegisterMyCommand()
        {
            Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentLockModeChanged += new DocumentLockModeChangedEventHandler(RedefineCommands);
        }
        private void RedefineCommands(object sender, DocumentLockModeChangedEventArgs e)
        {
            if (e.GlobalCommandName == "LINE")
            {
                e.Veto();
                LoadHead();
            }
        }

相关文章:

  • 2021-12-20
  • 2022-12-23
  • 2021-10-12
  • 2021-08-16
  • 2022-01-18
  • 2021-07-09
猜你喜欢
  • 2022-12-23
  • 2021-08-09
  • 2021-05-18
  • 2021-10-23
  • 2021-12-03
  • 2021-06-12
  • 2021-09-18
相关资源
相似解决方案