/// <summary>
 /// Initializes a new instance of the <see cref="LoadCombinations" /> class.
 /// </summary>
 /// <param name="app">The application.</param>
 /// <param name="analyzer">The analyzer.</param>
 /// <param name="loadCases">The load cases.</param>
 internal LoadCombinations(
     ApiCSiApplication app,
     Analyzer analyzer,
     LoadCases loadCases) : base(app)
 {
     _analyzer  = analyzer;
     _loadCases = loadCases;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LoadCombination" /> class.
 /// </summary>
 /// <param name="app">The application.</param>
 /// <param name="analyzer">The analyzer.</param>
 /// <param name="loadCases">The load cases.</param>
 /// <param name="loadCombinations">The load combinations.</param>
 /// <param name="name">The name.</param>
 private LoadCombination(
     ApiCSiApplication app,
     Analyzer analyzer,
     LoadCases loadCases,
     LoadCombinations loadCombinations,
     string name) : base(app, name)
 {
     _analyzer         = analyzer;
     _loadCases        = loadCases;
     _loadCombinations = loadCombinations;
 }
        /// <summary>
        /// Adds a new load combination.
        /// The new load combination must have a different name from all other load combinations and all load cases.
        /// If the name is not unique, an error will be returned.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="analyzer">The analyzer.</param>
        /// <param name="loadCases">The load cases.</param>
        /// <param name="loadCombinations">The load combinations.</param>
        /// <param name="uniqueNameLoadCombo">The name of a new load combination.</param>
        /// <param name="comboType">The load combination type to add.</param>
        /// <returns>LoadCombination.</returns>
        /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
        internal static LoadCombination Add(
            ApiCSiApplication app,
            Analyzer analyzer,
            LoadCases loadCases,
            LoadCombinations loadCombinations,
            string uniqueNameLoadCombo,
            eLoadComboType comboType)
        {
            ApiLoadCombination apiLoadCombinations = getApiLoadCombination(app);

            apiLoadCombinations.Add(uniqueNameLoadCombo, comboType);
            return(Factory(app, analyzer, loadCases, loadCombinations, uniqueNameLoadCombo));
        }
        /// <summary>
        /// Returns a new load combination class.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="analyzer">The analyzer.</param>
        /// <param name="loadCases">The load cases.</param>
        /// <param name="loadCombinations">The load combinations.</param>
        /// <param name="uniqueName">Unique load combination name.</param>
        /// <returns>Steel.</returns>
        internal static LoadCombination Factory(
            ApiCSiApplication app,
            Analyzer analyzer,
            LoadCases loadCases,
            LoadCombinations loadCombinations,
            string uniqueName)
        {
            LoadCombination loadCombination = new LoadCombination(app, analyzer, loadCases, loadCombinations, uniqueName);

            loadCombination.FillData();

            return(loadCombination);
        }
Esempio n. 5
0
        /// <summary>
        /// Factories the specified application.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="analyzer">The analyzer.</param>
        /// <param name="loadPatterns">The load patterns.</param>
        /// <param name="loadCases">The load cases.</param>
        /// <param name="uniqueName">Name of the unique.</param>
        /// <returns>MPT.CSI.OOAPI.Core.Program.Model.Loads.LoadCase.</returns>
        internal static LoadCase Factory(
            ApiCSiApplication app,
            Analyzer analyzer,
            LoadPatterns loadPatterns,
            LoadCases loadCases,
            string uniqueName)
        {
            Tuple <eLoadCaseType, eLoadCaseSubType> loadCaseType = GetCaseTypes(app?.Model?.Definitions?.LoadCases, uniqueName);

            switch (loadCaseType.Item1)
            {
            case eLoadCaseType.LinearStatic:
                return(StaticLinear.Factory(app, analyzer, loadPatterns, loadCases, uniqueName));

            case eLoadCaseType.NonlinearStatic when loadCaseType.Item2 == eLoadCaseSubType.Nonlinear:
                return(StaticNonlinear.Factory(app, analyzer, loadPatterns, loadCases, uniqueName));

            case eLoadCaseType.NonlinearStatic when loadCaseType.Item2 == eLoadCaseSubType.NonlinearStagedConstruction:
                return(StaticNonlinearStaged.Factory(app, analyzer, loadCases, uniqueName));

            case eLoadCaseType.Modal when loadCaseType.Item2 == eLoadCaseSubType.Eigen:
                return(ModalEigen.Factory(app, analyzer, uniqueName));

            case eLoadCaseType.Modal when loadCaseType.Item2 == eLoadCaseSubType.Ritz:
                return(ModalRitz.Factory(app, analyzer, uniqueName));

            case eLoadCaseType.ResponseSpectrum:
                return(ResponseSpectrum.Factory(app, analyzer, loadCases, uniqueName));

            case eLoadCaseType.LinearModalTimeHistory:
                return(TimeHistoryModalLinear.Factory(app, analyzer, uniqueName));

            case eLoadCaseType.NonlinearModalTimeHistory:
                return(TimeHistoryModalNonlinear.Factory(app, analyzer, uniqueName));

            case eLoadCaseType.LinearDirectIntegrationTimeHistory:
                return(TimeHistoryDirectLinear.Factory(app, analyzer, uniqueName));

            case eLoadCaseType.NonlinearDirectIntegrationTimeHistory:
                return(TimeHistoryDirectNonlinear.Factory(app, analyzer, uniqueName));

            default:
                return(null);
            }
        }