xiaoquansb 发表于 2019-9-2 14:58:00

CommandWillStart事件里的命令名是什么

public void fsa()
      {
            Autodesk..ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument.CommandWillStart += (new CommandEventHandler(Class1.MdiActiveDocument_CommandWillStart));
            Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument.CommandEnded += (new CommandEventHandler(Class1.MdiActiveDocument_CommandEnded));
      }
      private static void MdiActiveDocument_CommandWillStart(object sender, CommandEventArgs e)
      {
            Autodesk.AutoCAD.ApplicationServices.CommandEventArgs X = new Autodesk.AutoCAD.ApplicationServices.CommandEventArgs();
            String commandname = X.GlobalCommandName;
            Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(commandname);
      }
想做个命令执行的事件,然后获取命令名的地方卡住了,请各位大大帮忙看看,命令名不是GlobalCommandName吗?,应该是什么
原来String commandname = e.GlobalCommandName;

cairunbin 发表于 2019-9-4 14:23:00

你这是自己找到答案了?
页: [1]
查看完整版本: CommandWillStart事件里的命令名是什么