Exemplo n.º 1
0
        //------------------------------- DIALOG LAUNCHING ---------------------------------
        //
        //    Before invoking this application one needs to open any part/empty part in NX
        //    because of the behavior of the blocks.
        //
        //    Make sure the dlx file is in one of the following locations:
        //        1.) From where NX session is launched
        //        2.) $UGII_USER_DIR/application
        //        3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly
        //            recommended. This variable is set to a full directory path to a file
        //            containing a list of root directories for all custom applications.
        //            e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_BASE_DIR\ugii\menus\custom_dirs.dat
        //
        //    You can create the dialog using one of the following way:
        //
        //    1. Journal Replay
        //
        //        1) Replay this file through Tool->Journal->Play Menu.
        //
        //    2. USER EXIT
        //
        //        1) Create the Shared Library -- Refer "Block UI Styler programmer's guide"
        //        2) Invoke the Shared Library through File->Execute->NX Open menu.
        //
        //------------------------------------------------------------------------------
        public static void Main()
        {
            AddProgram theAddProgram = null;

            try
            {
                theAddProgram = new AddProgram();
                // The following method shows the dialog immediately
                theAddProgram.Show();
            }
            catch (Exception ex)
            {
                //---- Enter your exception handling code here -----
                theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
            }
            finally
            {
                if (theAddProgram != null)
                {
                    theAddProgram.Dispose();
                }
                theAddProgram = null;
            }
        }
Exemplo n.º 2
0
        public static int Main(string[] args)
        {
            #region  公共工具
            if (args[0] == "MENU_MoveObject")
            {
                MoveObject move = new MoveObject();
                move.Show();
            }
            if (args[0] == "MENU_MoveObjectMin")
            {
                MoveObjectOfCenter move = new MoveObjectOfCenter("MENU_MoveObjectMin");
                move.Create();
            }
            if (args[0] == "MENU_MoveObjectMax")
            {
                MoveObjectOfCenter move = new MoveObjectOfCenter("MENU_MoveObjectMax");
                move.Create();
            }
            if (args[0] == "MENU_MoveObjectRotateX")
            {
                MoveObjectOfCenter move = new MoveObjectOfCenter("MENU_MoveObjectRotateX");
                move.Create();
            }
            if (args[0] == "MENU_MoveObjectRotateY")
            {
                MoveObjectOfCenter move = new MoveObjectOfCenter("MENU_MoveObjectRotateY");
                move.Create();
            }
            if (args[0] == "MENU_MoveObjectRotateZ")
            {
                MoveObjectOfCenter move = new MoveObjectOfCenter("MENU_MoveObjectRotateZ");
                move.Create();
            }
            #endregion

            #region 电极设计
            if (args[0] == "MENU_SuperBox")
            {
                SuperBox superBox = new SuperBox();
                superBox.Show();
            }
            if (args[0] == "MENU_AnalyzeBodyAndFace")
            {
                AnalyzeBodyAndFace analyze = new AnalyzeBodyAndFace();
                analyze.Show();
            }

            if (args[0] == "MENU_AddEdmAsm")
            {
                AddEdmAsm add = new AddEdmAsm();
                add.Show();
            }
            if (args[0] == "MENU_AddWork")
            {
                AddWork add = new AddWork();
                add.Show();
            }
            if (args[0] == "MENU_EleStandardSeatZ+")
            {
                EleStandardSeatCreateForm form = new EleStandardSeatCreateForm("Z+");
                form.Show();
            }
            if (args[0] == "MENU_EleStandardSeatX+")
            {
                EleStandardSeatCreateForm form = new EleStandardSeatCreateForm("X-");
                form.Show();
            }
            if (args[0] == "MENU_EleStandardSeatY+")
            {
                EleStandardSeatCreateForm form = new EleStandardSeatCreateForm("Y+");
                form.Show();
            }
            if (args[0] == "MENU_EleStandardSeatX-")
            {
                EleStandardSeatCreateForm form = new EleStandardSeatCreateForm("X+");
                form.Show();
            }
            if (args[0] == "MENU_EleStandardSeatY-")
            {
                EleStandardSeatCreateForm form = new EleStandardSeatCreateForm("Y-");
                form.Show();
            }
            if (args[0] == "MENU_DeleteEle")
            {
                DeleteEle delete = new DeleteEle();
                delete.Show();
            }
            if (args[0] == "MENU_PositionEle")
            {
                PositionEle posit = new PositionEle();
                posit.Show();
            }
            if (args[0] == "MENU_Interference")
            {
                Interference inter = new Interference();
                inter.Show();
            }
            if (args[0] == "MENU_WorkpieceDrawing")
            {
                new WorkpieceDrawingCreateForm().Show();
            }
            if (args[0] == "MENU_ElectrodeDrawing")
            {
                new ElectrodeDrawingCreateForm().Show();
            }
            if (args[0] == "MENU_AlterEleName")
            {
                new AlterEleName().Show();
            }

            if (args[0] == "MENU_CopyAsm")
            {
                new CopyAsm().Show();
            }
            if (args[0] == "MENU_Bom")
            {
                new BomCreateForm().Show();
            }
            #endregion
            // test.ces();
            if (args[0] == "MENU_EleProgram")
            {
                EleProgram mode = new EleProgram();
                mode.Show();
            }
            if (args[0] == "MENU_Program")
            {
                CrateUserDefinedOperation.Create();
            }
            if (args[0] == "MENU_ExportElectrode")
            {
                ExportElectrode ele = new ExportElectrode();
                ele.Show();
            }
            if (args[0] == "MENU_AddProgram")
            {
                AddProgram ele = new AddProgram();
                ele.Show();
            }
            if (args[0] == "MENU_PostShopdoc")
            {
                PostShopdocCreateForm.Show();
            }

            return(1);
        }
Exemplo n.º 3
0
        public static int Main(string[] args)
        {
            #region  公共工具
            if (args[0] == "MENU_MoveObject")
            {
                MoveObject move = new MoveObject();
                move.Show();
            }
            if (args[0] == "MENU_MoveComponent")
            {
                MoveComponent move = new MoveComponent();
                move.Show();
            }

            if (args[0] == "MENU_MoveObjectMin")
            {
                VisibleObjects vis   = new VisibleObjects();
                Point3d        endPt = new Point3d(vis.Aoo.CenterPt.X, vis.Aoo.CenterPt.Y, vis.Aoo.CenterPt.Z - vis.Aoo.DisPt.Z);
                IMoveBulider   move  = new MovePointToPointBuilder(new Point3d(0, 0, 0), endPt);
                move.Move(vis.VisObjs.ToArray());
            }
            if (args[0] == "MENU_MoveObjectMax")
            {
                VisibleObjects vis   = new VisibleObjects();
                Point3d        endPt = new Point3d(vis.Aoo.CenterPt.X, vis.Aoo.CenterPt.Y, vis.Aoo.CenterPt.Z + vis.Aoo.DisPt.Z);
                IMoveBulider   move  = new MovePointToPointBuilder(new Point3d(0, 0, 0), endPt);
                move.Move(vis.VisObjs.ToArray());
            }
            if (args[0] == "MENU_MoveObjectRotateX")
            {
                VisibleObjects vis  = new VisibleObjects();
                IMoveBulider   move = new MoveRotateBuilder(new Vector3d(1, 0, 0), 90);
                move.Move(vis.VisObjs.ToArray());
            }
            if (args[0] == "MENU_MoveObjectRotateY")
            {
                VisibleObjects vis  = new VisibleObjects();
                IMoveBulider   move = new MoveRotateBuilder(new Vector3d(0, 1, 0), 90);
                move.Move(vis.VisObjs.ToArray());
            }
            if (args[0] == "MENU_MoveObjectRotateZ")
            {
                VisibleObjects vis  = new VisibleObjects();
                IMoveBulider   move = new MoveRotateBuilder(new Vector3d(0, 0, 1), 90);
                move.Move(vis.VisObjs.ToArray());
            }
            if (args[0] == "MENU_AnalyzeBodyAndFace")
            {
                AnalyzeBodyAndFace analyze = new AnalyzeBodyAndFace();
                analyze.Show();
            }

            #endregion

            #region 电极设计
            if (args[0] == "MENU_SuperBox")
            {
                SuperBox superBox = new SuperBox();
                superBox.Show();
            }

            if (args[0] == "MENU_AddEdmAsm")
            {
                AddEdmAsm add = new AddEdmAsm();
                add.Show();
            }
            if (args[0] == "MENU_AddWorkpiece")
            {
                AddWorkpiece add = new AddWorkpiece();
                add.Show();
            }

            if (args[0] == "MENU_AddWork")
            {
                AddWork add = new AddWork();
                add.Show();
            }
            if (args[0] == "MENU_CheckElectrode")
            {
                CheckElectrode check = new CheckElectrode();
                check.Show();
            }
            if (args[0] == "MENU_MoveBody")
            {
                MoveBody move = new MoveBody();
                move.Show();
            }

            if (args[0] == "MENU_EleStandardSeatZ+")
            {
                ElectrodeCreateExpAndMatr expAndMatr = new ElectrodeCreateExpAndMatr(new ZPositiveElectrodeMatrix());
                CreateEleStandardSeatForm form       = new CreateEleStandardSeatForm(expAndMatr);
                form.Show();
            }
            if (args[0] == "MENU_EleStandardSeatX+")
            {
                ElectrodeCreateExpAndMatr expAndMatr = new ElectrodeCreateExpAndMatr(new XNegativeElectrodeMatrix());
                CreateEleStandardSeatForm form       = new CreateEleStandardSeatForm(expAndMatr);
                form.Show();
            }
            if (args[0] == "MENU_EleStandardSeatY+")
            {
                ElectrodeCreateExpAndMatr expAndMatr = new ElectrodeCreateExpAndMatr(new YPositiveElectrodeMatrix());
                CreateEleStandardSeatForm form       = new CreateEleStandardSeatForm(expAndMatr);
                form.Show();
            }
            if (args[0] == "MENU_EleStandardSeatX-")
            {
                ElectrodeCreateExpAndMatr expAndMatr = new ElectrodeCreateExpAndMatr(new XPositiveElectrodeMatrix());
                CreateEleStandardSeatForm form       = new CreateEleStandardSeatForm(expAndMatr);
                form.Show();
            }
            if (args[0] == "MENU_EleStandardSeatY-")
            {
                ElectrodeCreateExpAndMatr expAndMatr = new ElectrodeCreateExpAndMatr(new YNegativeElectrodeMatrix());
                CreateEleStandardSeatForm form       = new CreateEleStandardSeatForm(expAndMatr);
                form.Show();
            }

            if (args[0] == "MENU_ElectrodeColor")
            {
                ElectrodeColor color = new ElectrodeColor();
                color.Show();
            }

            if (args[0] == "MENU_DeleteEle")
            {
                DeleteEle delete = new DeleteEle();
                delete.Show();
            }
            if (args[0] == "MENU_CopyElectrode")
            {
                CopyElectrode copy = new CopyElectrode();
                copy.Show();
            }
            if (args[0] == "MENU_PositionEle")
            {
                PositionEle posit = new PositionEle();
                posit.Show();
            }
            if (args[0] == "MENU_MoovElectrode")
            {
                new MoovElectrode().Show();
            }

            if (args[0] == "MENU_Interference")
            {
                Interference inter = new Interference();
                inter.Show();
            }

            if (args[0] == "MENU_WorkpieceDrawing")
            {
                new WorkpieceDrawingCreateForm().Show();
            }

            if (args[0] == "MENU_ElectrodeDrawing")
            {
                new ElectrodeDrawingCreateForm().Show();
            }

            if (args[0] == "MENU_Bom")
            {
                new BomCreateForm().Show();
            }
            if (args[0] == "MENU_AlterComponent")
            {
                new AlterComponent().Show();
            }
            if (args[0] == "MENU_CopyAsm")
            {
                new CopyAsm().Show();
            }
            if (args[0] == "MENU_ExportEleCam")
            {
                new ExportEleCamCreateForm().Show();
            }
            if (args[0] == "MENU_ExportEleCMM")
            {
                new ExportEleCMMCreateForm().Show();
            }
            #endregion

            if (args[0] == "MENU_EleProgram")
            {
                EleProgramCreateForm mode = new EleProgramCreateForm();
                mode.Show();
            }
            if (args[0] == "MENU_AddProgram")
            {
                AddProgram ele = new AddProgram();
                ele.Show();
            }

            if (args[0] == "MENU_Program")
            {
                UserOperation.CreateUserOper();
            }
            if (args[0] == "MENU_OffsetBodyGapVauleUi")
            {
                new OffsetBodyGapVauleUi().Show();
            }

            if (args[0] == "MENU_PostShopdoc")
            {
                PostShopdocCreateForm.Show();
            }

            //  Test.User();
            return(1);
        }