Hi,
I’m working on a project that analyse a bridge configuration using Karamba 3.1.41125. It worked without problem for a while but now I get this exception:
SEHException: External component has thrown an exception.
The error is similar to this post:
In my case, the exception always occurs. The only way to fix it is to comment out the analysis function in the C# component, output only the assembled Karamba model, and then perform the analysis using the Analyze component (which always works). Once the analysis is complete, I can uncomment the analysis function in the C# component. After this, the exception no longer appears until I reopen Rhino.
Here is the code snippet that generate the error:
public static void AnalyseOneBridge(BridgeUniqueConfiguration oneBRG, List<double> posToRetrieve, bool retrieveForces, bool retrieveDisplacements, int stepReductionFactor, List<MovingLoadCase> movingLCListToUse, out List<Model> modelsOut)
{
// CREATE THE STEEL AND CONCRETE MATERIALS
// CREATE COMMON ELEMENTS
// CREATE MODEL ELEMENTS
var modelS = AssembleModelFactory.CreateModel_S(oneBRG, materials, supports, intDiaphElements, intDiaphRlElements);
var modelS1n = AssembleModelFactory.CreateModel_S1n(oneBRG, materials, supports, intDiaphElements, intDiaphRlElements, stepReductionFactor, movingLCListToUse);
var modelS3n = AssembleModelFactory.CreateModel_S3n(oneBRG, materials, supports, intDiaphElements, intDiaphRlElements, stepReductionFactor, movingLCListToUse);
// ANALYSE THE MODELS
List<Model> models = new()
{
RunAnalysis(modelS),
RunAnalysis(modelS1n),
RunAnalysis(modelS3n)
};
// RETRIEVE RESULTS FOR THE GIRDERS
oneBRG.AllResults.LoadCasesResultsList.Clear();
RetrieveGirdersResults(oneBRG, models, posToRetrieve, retrieveForces, retrieveDisplacements);
modelsOut = models;
}
public static Model RunAnalysis(Model model)
{
List<string> LCList = model.lcCombinationCollection.OrderedLoadCaseCombinations.Select<LoadCaseCombination, string>((Func<LoadCaseCombination, string>) (i => ((LoadComponent) i).Name)).ToList<string>();
Analyze.solve(model,LCList,out _,out _,out _,out Model AnalysedModel,out string warning); //<--- Error there
return AnalysedModel;
}
I’m using a custom .dll to generate the bridge configuration, so it’s challenging for me to create a simplified version that reproduces the same issue.