Exemplo n.º 1
0
        //新建图纸页按钮
        private void tsrbtnAdd_Click(object sender, EventArgs e)
        {
            TreeNode sel = tvwSheet.SelectedNode;

            if (sel == null || (sel.Tag.ToString() != "Gongyi" && sel.Tag.ToString() != "Gongxu"))
            {
                SetStatusLabel("请选中树中工艺或工序节点", 1);
                return;
            }
            int    index    = sel.Index;
            string filename = XML3DPPM.GetModelName(0, index, XmlFile);

            if (string.IsNullOrEmpty(filename))
            {
                SetStatusLabel("选中节点下无模型,请在编辑模型模块中创建模型!", 1);
                return;
            }
            Part prt = NXFun.OpenPrt(ToFullPath(filename));

            if (prt == null)
            {
                SetStatusLabel("打开模型错误!", 1);
                return;
            }
            mainDlg.Enabled = false;    //如果这里不禁用主窗口,再点击一次添加或退出就会出错,而如果直接隐藏主窗口有时会把NX隐藏,奇怪的很。
            // mainDlg.WindowState = FormWindowState.Minimized;
            CreateSheet.MainFun();
            mainDlg.Enabled = true;
            //  mainDlg.WindowState = FormWindowState.Normal;
            SetStatusLabel("添加图纸页返回", 2);
            FreshSheetTree();
        }
Exemplo n.º 2
0
 public static void MainFun()
 {
     try
     {
         theCreateSheet = new CreateSheet();
         theCreateSheet.Show();
     }
     catch (Exception ex)
     {
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     finally
     {
         theCreateSheet.Dispose();
     }
 }
Exemplo n.º 3
0
 public static void MainFun()
 {
     try
     {
         theCreateSheet = new CreateSheet();
         theCreateSheet.Show();
     }
     catch (Exception ex)
     {
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     finally
     {
         theCreateSheet.Dispose();
     }
 }