AutoCAD.Net/C#.Net QQ群:193522571 点击对话框按钮去屏幕选择点或进行操作时,闪屏,已经解决!

        //a button click call back event...
        private void getEntity_Click(object sender, EventArgs e)
        {
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            Database db = doc.Database;
            //this - is the modal dialog box.
            using (EditorUserInteraction UI = ed.StartUserInteraction(this))
            {
                PromptEntityResult entResult = ed.GetEntity("
Select entity");
                if (entResult.Status != PromptStatus.OK)
                    return;
                using (Transaction Tx = db.TransactionManager.StartTransaction())
                {
                    DBObject obj = Tx.GetObject(entResult.ObjectId, OpenMode.ForRead);
                    ed.WriteMessage(obj.GetType().Name);
                    Tx.Commit();
                }
            }
        }
原文地址:https://www.cnblogs.com/swtool/p/3689022.html