Пример #1
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         if (user.UserSucceed && user.Jurisd.GetElectrodeJurisd())
         {
             if (ASMModel.IsAsm(workPart))
             {
                 asmModel = new ASMModel(workPart);
             }
             else
             {
                 asmModel = ASMCollection.GetAsmModel(workPart);
                 if (asmModel != null)
                 {
                     PartUtils.SetPartDisplay(asmModel.PartTag);
                     workPart = asmModel.PartTag;
                 }
                 else
                 {
                     theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "无法找到ASM部件!");
                     return(0);
                 }
             }
             asmColl = new ASMCollection(asmModel);
             theDialog.Show();
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #2
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         UserSingleton user = UserSingleton.Instance();
         if (user.UserSucceed && user.Jurisd.GetElectrodeJurisd())
         {
             if (workPart.ComponentAssembly.RootComponent != null)
             {
                 theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "工件是装配档");
                 return(0);
             }
             if (workPart.PartUnits == BasePart.Units.Inches)
             {
                 theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "工件是英制");
                 return(0);
             }
             workPart.Save(BasePart.SaveComponents.False, BasePart.CloseAfterSave.False);
             theDialog.Show();
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #3
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         UserSingleton user = UserSingleton.Instance();
         if (user.UserSucceed && user.Jurisd.GetCAMJurisd())
         {
             Part workPart = theSession.Parts.Work;
             if (!theSession.ApplicationName.Equals("UG_APP_MANUFACTURING", StringComparison.CurrentCultureIgnoreCase))
             {
                 theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "请切换到加工模块");
                 return(0);
             }
             try
             {
                 NXOpen.CAM.NCGroup parent = (NXOpen.CAM.NCGroup)workPart.CAMSetup.CAMGroupCollection.FindObject("AAA");
                 program = new CreateProgramBuilder(parent);
                 theDialog.Show();
             }
             catch
             {
             }
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
        //------------------------------------------------------------------------------
        //This method shows the dialog on the screen
        //------------------------------------------------------------------------------
        public NXOpen.UIStyler.DialogResponse Show()
        {
            try
            {
                //CHECK WORKING OBJECT
                Logger.Write("--- WORKING OBJECT CHECK ---");

                NXOpen.NXObject workObj = theSession.Parts.BaseWork;
                if (workObj.GetType().ToString() != "NXOpen.CAE.SimPart")
                {
                    Logger.Write(workObj.GetType().ToString() + "  --> EXPECTED A SIM OBJECT TO BE THE WORKING OBJECT:  ABORT");
                    Logger.Show();
                }
                else
                {
                    // SHOW GUI
                    theDialog.Show();
                }
            }
            catch (Exception ex)
            {
                //---- Enter your exception handling code here -----
                theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
            }
            return(0);
        }
Пример #5
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         UserSingleton user = UserSingleton.Instance();
         if (user.UserSucceed && user.Jurisd.GetElectrodeJurisd())
         {
             Part workPart = theSession.Parts.Work;
             if (!ParentAssmblieInfo.IsWork(workPart))
             {
                 theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "请切换到WORK为显示部件!");
                 return(0);
             }
             WorkModel model = new WorkModel(workPart);
             this.matr = model.Info.Matr;
             theDialog.Show();
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #6
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         user = UserSingleton.Instance();
         if (user.UserSucceed && user.Jurisd.GetElectrodeJurisd())
         {
             Part disPart = theSession.Parts.Display;
             if (!ASMModel.IsAsm(disPart))
             {
                 asm = ASMCollection.GetAsmModel(disPart);
                 if (asm != null)
                 {
                     PartUtils.SetPartDisplay(asm.PartTag);
                 }
                 else
                 {
                     theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "工作部件无法找到ASM!");
                     return(0);
                 }
             }
             else
             {
                 asm = new ASMModel(disPart);
             }
             theDialog.Show();
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #7
0
        //------------------------------------------------------------------------------
        //This method shows the dialog on the screen
        //------------------------------------------------------------------------------
        public NXOpen.UIStyler.DialogResponse Show()
        {
            try
            {
                UserSingleton user = UserSingleton.Instance();
                if (user.UserSucceed && user.Jurisd.GetComm())
                {
                    CsysUtils.SetWcsToAbs();
                    Component ct = workPart.ComponentAssembly.RootComponent;
                    if (ct == null)
                    {
                        theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "显示部件不是装配档!");
                        return(0);
                    }

                    theDialog.Show();
                }
            }
            catch (Exception ex)
            {
                //---- Enter your exception handling code here -----
                theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
            }
            return(0);
        }
Пример #8
0
        //------------------------------------------------------------------------------
        //This method shows the dialog on the screen
        //------------------------------------------------------------------------------
        public NXOpen.UIStyler.DialogResponse Show()
        {
            try
            {
                string partType = AttributeUtils.GetAttrForString(workPart, "PartType");
                if (!partType.Equals("Work"))
                {
                    theUI.NXMessageBox.Show("错误!", NXMessageBox.DialogType.Error, "请切换到Work档下!");
                    return(0);
                }
                work.GetModelForPart(workPart);
                string asm  = work.MoldInfo.MoldNumber + "-" + work.MoldInfo.WorkpieceNumber + "-ASM";
                string name = work.MoldInfo.MoldNumber + "-" + work.MoldInfo.WorkpieceNumber;

                foreach (Part part in theSession.Parts)
                {
                    if (part.Name.Equals(asm))
                    {
                        assemble = AssembleSingleton.Instance().GetAssemble(name);
                    }
                }
                if (assemble == null)
                {
                    theUI.NXMessageBox.Show("错误!", NXMessageBox.DialogType.Error, "无法找到ASM档!");
                    return(0);
                }
                theDialog.Show();
            }
            catch (Exception ex)
            {
                //---- Enter your exception handling code here -----
                theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
            }
            return(0);
        }
Пример #9
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         Part workPart = theSession.Parts.Work;
         if (workPart.ComponentAssembly.RootComponent != null)
         {
             theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "工件是装配档");
             return(0);
         }
         if (workPart.PartUnits == BasePart.Units.Inches)
         {
             theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "工件是英制");
             return(0);
         }
         bool anyPartsModified1;
         NXOpen.PartSaveStatus partSaveStatus1;
         Session.GetSession().Parts.SaveAll(out anyPartsModified1, out partSaveStatus1);
         theDialog.Show();
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #10
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         theDialog.Show();
     }
     catch (Exception ex)
     {
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #11
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         theDialog.Show();
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #12
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         if (user.UserSucceed && user.Jurisd.GetElectrodeJurisd())
         {
             theDialog.Show();
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #13
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         UserSingleton us = UserSingleton.Instance();
         if (us.UserSucceed && us.Jurisd.GetCAMJurisd())
         {
             user = us.CreatorUser;
             theDialog.Show();
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #14
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         UserSingleton user = UserSingleton.Instance();
         if (user.UserSucceed && user.Jurisd.GetComm())
         {
             CsysUtils.SetWcsToAbs();
             theDialog.Show();
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #15
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         asmPart = ElectrodeAssembleCollection.GetAsmCollection();
         if (asmPart == null)
         {
             theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "无法找到ASM档!");
             return(0);
         }
         theDialog.Show();
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #16
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         Part workPart = theSession.Parts.Work;
         if (workPart.ComponentAssembly.RootComponent != null)
         {
             theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "工件是装配档");
             return(0);
         }
         theDialog.Show();
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #17
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         string type = AttributeUtils.GetAttrForString(workPart, "PartType");
         if (!type.Equals("ASM", StringComparison.CurrentCultureIgnoreCase))
         {
             theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "请切换到ASM档");
             return(0);
         }
         theDialog.Show();
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #18
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         workPart = theSession.Parts.Work;
         string type = AttributeUtils.GetAttrForString(workPart, "PartType");
         if (type != "ASM")
         {
             theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "请切换ASM档为工作部件!");
             return(0);
         }
         builder = new AddWorkBuilder(workPart);
         theDialog.Show();
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #19
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         UserSingleton user = UserSingleton.Instance();
         if (user.UserSucceed && user.Jurisd.GetElectrodeJurisd())
         {
             if (!ParentAssmblieInfo.IsWork(workPart))
             {
                 theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "请设置WORK为工作部件");
                 return(0);
             }
             theDialog.Show();
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #20
0
 //------------------------------------------------------------------------------
 //This method shows the dialog on the screen
 //------------------------------------------------------------------------------
 public NXOpen.UIStyler.DialogResponse Show()
 {
     try
     {
         Part   workPart = theSession.Parts.Work;
         string type     = AttributeUtils.GetAttrForString(workPart, "PartType");
         if (type != "ASM")
         {
             theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "请切换ASM档为工作部件!");
             return(0);
         }
         MoldInfoModel mold = new MoldInfoModel(workPart);
         assemble = AssembleSingleton.Instance().GetAssemble(mold.MoldNumber + "-" + mold.WorkpieceNumber);
         theDialog.Show();
         if (err.Count != 0)
         {
             bool           anyPartsModified;
             PartSaveStatus saveStatus;
             Part           part = null;
             if ((part = ReplacePart.Replace(assemble.Asm, moldInfo)) != null)
             {
                 moldInfo.SetAttribute(part);
                 theSession.Parts.SaveAll(out anyPartsModified, out saveStatus);
                 err.Add("修改" + assemble.Asm.AssembleName + "成功!");
             }
             foreach (string st in err)
             {
                 ClassItem.Print(st);
             }
         }
     }
     catch (Exception ex)
     {
         //---- Enter your exception handling code here -----
         theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
     }
     return(0);
 }
Пример #21
0
        //------------------------------------------------------------------------------
        //This method shows the dialog on the screen
        //------------------------------------------------------------------------------
        public NXOpen.UIStyler.DialogResponse Show()
        {
            try
            {
                Part workPart = theSession.Parts.Work;

                string type = AttributeUtils.GetAttrForString(workPart, "PartType");
                if (!type.Equals("ASM", StringComparison.CurrentCultureIgnoreCase))
                {
                    theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "请切换到ASM档");
                    return(0);
                }
                MoldInfoModel moldInfo = new MoldInfoModel(workPart);
                string        name     = moldInfo.MoldNumber + "-" + moldInfo.WorkpieceNumber;
                assemble = AssembleSingleton.Instance().GetAssemble(name);
                theDialog.Show();
            }
            catch (Exception ex)
            {
                //---- Enter your exception handling code here -----
                theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
            }
            return(0);
        }