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");
        }
再加一个事件的方法可了
//游天居士到此一游
                    
                
                
            
        
浙公网安备 33010602011771号