autoCAD C#用COM方式得到鼠标右键BeginRightClick事件

C++有BeginRightClick反应器。但是arx.net里没有相应的事件。我们只能添加Com得到这个事件。

            AcadApplication acAppCom;
            // Set the global variable to hold a reference to the application and
            // register the BeginFileDrop COM event

            acAppCom = Application.AcadApplication as AcadApplication;
            acAppCom.ActiveDocument.BeginRightClick += new Autodesk.AutoCAD.Interop._DAcadDocumentEvents_BeginRightClickEventHandler(ee);
    

需要添加2个引用

        void RightClick(object e)
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            doc.Editor.WriteMessage("你已经点右键\n");
        }

再加一个事件的方法可了

 //游天居士到此一游

posted @ 2012-10-20 09:52  游天居士  阅读(675)  评论(0编辑  收藏  举报