private void OnPageClosing(swPropertyManagerPageCloseReasons_e reason, SwEx.PMPage.Base.ClosingArg arg) { if (reason == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay) { IBody2 body = null; Exception err = null; try { var cylParams = m_Model.GetCylinderParameters(m_CurrentPart, m_CurrentParameters.Direction, m_CurrentParameters.ConcenticWithCylindricalFace, m_CurrentParameters.StockStep, m_CurrentParameters.ExtraRadius); body = m_Model.CreateCylindricalStock(cylParams); } catch (Exception ex) { err = ex; } if (body == null) { arg.Cancel = true; arg.ErrorTitle = "Cylindrical Stock Error"; arg.ErrorMessage = err?.Message; } } }
private CylinderParams GetCylinderParams(IModelDoc2 model, RoundStockFeatureParameters parameters) { var cylParams = m_StockModel.GetCylinderParameters(model as IPartDoc, parameters.Direction, parameters.ConcenticWithCylindricalFace, parameters.StockStep, parameters.ExtraRadius); return(cylParams); }