//------------------------------------------------------------------------------ //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); }
public ToolDataModel(NXOpen.CAM.NCGroup np) { UFSession theUFSession = UFSession.GetUFSession(); this.ToolNcGroup = np; this.ToolName = np.Name; double toolDia; try { theUFSession.Param.AskDoubleValue(np.Tag, UFConstants.UF_PARAM_TL_DIAMETER, out toolDia); this.ToolDia = toolDia; } catch { this.ToolDia = 0; } double toolLowerRad; try { theUFSession.Param.AskDoubleValue(np.Tag, UFConstants.UF_PARAM_TL_COR1_RAD, out toolLowerRad); this.ToolLowerRad = toolLowerRad; } catch { this.ToolLowerRad = 0; } double toolLength; try { theUFSession.Param.AskDoubleValue(np.Tag, UFConstants.UF_PARAM_TL_HEIGHT, out toolLength); this.ToolLength = toolLength; } catch { this.ToolLength = 0; } double fluteLength; try { theUFSession.Param.AskDoubleValue(np.Tag, UFConstants.UF_PARAM_TL_FLUTE_LN, out fluteLength); this.FluteLength = fluteLength; } catch { this.FluteLength = 0; } int toolNumber; try { theUFSession.Param.AskIntValue(np.Tag, UFConstants.UF_PARAM_TL_NUMBER, out toolNumber); this.ToolNumber = toolNumber; } catch { this.ToolNumber = 0; } int adiust; try { theUFSession.Param.AskIntValue(np.Tag, UFConstants.UF_PARAM_TL_ADJ_REG, out adiust); this.AdiustRegister = adiust; } catch { this.AdiustRegister = 0; } int cutcom; try { theUFSession.Param.AskIntValue(np.Tag, UFConstants.UF_PARAM_TL_CUTCOM_REG, out cutcom); this.CutcomRegister = cutcom; } catch { this.CutcomRegister = 0; } }