diff --git a/FemDesign.Core/Calculate/Analysis.cs b/FemDesign.Core/Calculate/Analysis.cs index c4724f36..759f884b 100644 --- a/FemDesign.Core/Calculate/Analysis.cs +++ b/FemDesign.Core/Calculate/Analysis.cs @@ -600,9 +600,11 @@ public void SetImperfectionAnalysis(FemDesignConnection connection) internal void _setImperfectionAnalysis(List loadCombination) { - //this.Comb.CombItem.Clear(); - - // check if + //check if comb is defined. if not, create a new one. if exist, clear it + if (this.Comb == null) + this.Comb = new Comb(); + else + this.Comb.CombItem.Clear(); foreach (var element in loadCombination) { diff --git a/FemDesign.Examples/C#/Practical example - Run analysis/Program.cs b/FemDesign.Examples/C#/Practical example - Run analysis/Program.cs index da381988..a8a821b8 100644 --- a/FemDesign.Examples/C#/Practical example - Run analysis/Program.cs +++ b/FemDesign.Examples/C#/Practical example - Run analysis/Program.cs @@ -9,6 +9,7 @@ using FemDesign.Results; using FemDesign.Calculate; using System.Linq.Expressions; +using FemDesign.Loads; namespace FemDesign.Examples @@ -221,6 +222,18 @@ static void Main() var combDefault = Calculate.Comb.Default(); + + var loadCombinations = new List { "SNOW LEAD", "WIND LEAD", "ULS VERTICAL" }; + var imperfectionSettings = new Calculate.Imperfection + ( + loadCombinations, + new List { 5, 4,2 }, + true, + 5, + true + ); + + // RUN ANALYSIS Analysis analysis; @@ -237,13 +250,17 @@ static void Main() analysis = new Analysis(comb: noComb, calcCase: true, calcComb: true); connection.RunAnalysis(analysis); + analysis = new Analysis(comb: combDefault, calcCase: true, calcComb: true); connection.RunAnalysis(analysis); analysis = new Analysis(freq: freqSettings, calcFreq: true); connection.RunAnalysis(analysis); - analysis = new Analysis(stability: stabilitySettings, calcStab: true); + //analysis = new Analysis(stability: stabilitySettings, calcStab: true); + //connection.RunAnalysis(analysis); + + analysis = new Analysis(imperfection: imperfectionSettings, calcImpf: true); connection.RunAnalysis(analysis); } }