コード例 #1
0
        EntityDiff()
        {
            Editor ed = AcadApp.Application.DocumentManager.MdiActiveDocument.Editor;

            PromptEntityResult res = ed.GetEntity("\nSelect first entity");

            if (res.Status != PromptStatus.OK)
            {
                return;
            }
            ObjectId objId1 = res.ObjectId;

            res = ed.GetEntity("\nSelect second entity");
            if (res.Status != PromptStatus.OK)
            {
                return;
            }
            ObjectId objId2 = res.ObjectId;

            using (TransactionHelper trHlp = new TransactionHelper()) {
                trHlp.Start();

                EntityDiff dbox = new EntityDiff(objId1, objId2, trHlp);
                dbox.Text = "Diff Objects";
                AcadApp.Application.ShowModalDialog(dbox);

                trHlp.Commit();
            }
        }
コード例 #2
0
ファイル: EntityDiff.cs プロジェクト: zhengjian211/MgdDbg
        DataItemSelected(object sender, System.EventArgs e)
        {
            Debug.Assert((m_lvData.SelectedItems.Count > 1) == false);

            if (m_lvData.SelectedItems.Count != 0)
            {
                ListViewItem item = m_lvData.SelectedItems[0];
                if (item.SubItems.Count != 3)
                {
                    return;
                }

                Object[] objs = new Object[2];
                objs[0] = item.SubItems[1].Tag;
                objs[1] = item.SubItems[2].Tag;
                if (objs[0] == null || objs[1] == null)
                {
                    return;
                }

                EntityDiff dbox = new EntityDiff(objs[0], objs[1]);
                AcadApp.Application.ShowModalDialog(dbox);
            }
        }