Beispiel #1
0
        /// <summary>
        /// 对象选中
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void MdiActiveDocument_ImpliedSelectionChanged(object sender, EventArgs e)
        {
            try
            {
                var pkf = PublicMethod.Instance.Editor.SelectImplied();
                if (pkf.Status == PromptStatus.OK)
                {
                    ObjectOperate.isRollback = false;
                    ImpliedSelectionIds      = pkf.Value.GetObjectIds();

                    selectedEntityId = ImpliedSelectionIds[ImpliedSelectionIds.Length - 1];
                    ObjectContextMenu.ShowAttribute(selectedEntityId);
                    ObjectContextMenu.AddOrRefreshConnectCtr(false);
                }
            }
            catch
            {
            }
        }
Beispiel #2
0
        public static void Application_PreTranslateMessage(object sender, PreTranslateMessageEventArgs e)
        {
            try
            {
                if (acadApp.DocumentManager.MdiActiveDocument != null)
                {
                    var ed = acadApp.DocumentManager.MdiActiveDocument.Editor;
                    switch (e.Message.message)
                    {
                    case WM_SYSKEYDOWN:
                        if (e.Message.wParam.ToInt32() == 65)
                        {
                            ObjectContextMenu.AddOrRefreshConnectCtr(true);
                        }
                        else if (e.Message.wParam.ToInt32() == 88)
                        {
                            ObjectContextMenu.ShowBulkChange();
                        }
                        else if (e.Message.wParam.ToInt32() == 81)
                        {
                            PublicMethod.Instance.SendCommend("pan\n");
                        }
                        break;

                    case WM_MOUSEWHEEL:
                        //System.Windows.Forms.MessageBox.Show("你在CAD操作中转动滚轮了!");
                        showmap();
                        break;

                    case WM_MOUSEMOVE:
                        // System.Windows.Forms.MessageBox.Show("你在CAD操作中移动鼠标了!");
                        break;

                    case WM_LBUTTONDOWN:
                        //System.Windows.Forms.MessageBox.Show("你在CAD操作中按下左键了!");
                        point = ed.PointToWorld(new Point(e.Message.pt_x, e.Message.pt_y));
                        var leftbuttondown = new FixEntityArgs {
                            Position = point
                        };
                        if (LeftButtonDownEventHander != null)
                        {
                            LeftButtonDownEventHander(new object(), leftbuttondown);
                        }
                        break;

                    case WM_LBUTTONUP:
                        //System.Windows.Forms.MessageBox.Show("你在CAD操作中弹起左键了!");
                        if (bpan)
                        {
                            showmap();
                        }
                        break;

                    case WM_MBUTTONUP:
                        //System.Windows.Forms.MessageBox.Show("你在CAD操作中弹起中键了!");
                        showmap();
                        break;
                    }
                }
            }
            catch (System.Exception ex)
            {
                //LogManager.Instance.Error(ex);
            }
        }