/// <summary> /// Internal constructor. Used for GH components and Dynamo nodes. /// </summary> public LoadCombination(string name, LoadCombType type, List <LoadCase> loadCase, List <double> gamma) { this.EntityCreated(); this.Name = name; this.Type = type; if (loadCase.GetType() == typeof(List <LoadCase>) && gamma.GetType() == typeof(List <double>)) { List <LoadCase> loadCases = (List <LoadCase>)loadCase; List <double> gammas = (List <double>)gamma; if (loadCases.Count == gammas.Count) { for (int i = 0; i < loadCases.Count; i++) { this.AddLoadCase(loadCases[i], gammas[i]); } } else { throw new System.ArgumentException("loadCase and gamma must have equal length"); } } else { throw new System.ArgumentException("loadCase must be Loads.LoadCase or List<Loads.LoadCase>, gamma must be double or List<double>"); } }
/// <summary> /// Converts the Enum combination type to string /// </summary> /// <param name="combinationType"></param> /// <returns>The combination type as a string</returns> private LoadCombType LoadCombinationType(ELoadCombinationType combinationType) { LoadCombType loadCombinationType = LoadCombType.UltimateOrdinary; if (combinationType == ELoadCombinationType.SixTenA || combinationType == ELoadCombinationType.SixTenB) { loadCombinationType = LoadCombType.UltimateOrdinary; } else if (combinationType == ELoadCombinationType.Characteristic) { loadCombinationType = LoadCombType.ServiceabilityCharacteristic; } else if (combinationType == ELoadCombinationType.Frequent) { loadCombinationType = LoadCombType.ServiceabilityFrequent; } else if (combinationType == ELoadCombinationType.QuasiPermanent) { loadCombinationType = LoadCombType.ServiceabilityQuasiPermanent; } return(loadCombinationType); }