乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 38|回复: 1

CommandWillStart事件里的命令名是什么

[复制链接]

30

主题

95

帖子

7

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
215
发表于 2019-9-2 14:58:00 | 显示全部楼层 |阅读模式
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;
回复

使用道具 举报

9

主题

66

帖子

5

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
102
发表于 2019-9-4 14:23:00 | 显示全部楼层
你这是自己找到答案了?
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-13 02:52 , Processed in 0.492514 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表