Results Retrieval on Beams in IronPython


Thanks to the Great scripting example on Results Retrieval on Shells, I manage to do similar stuff on a structural model made of beams. I wonder how I can retrieve the utilization of beams in IronPython?

Here is a snippet from the example (which works nicely!):

# ... other karamba related CLR import
import feb # Karamba's C++ library (undocumented in the API)

# clone the model and its list of elements to avoid side effects
model = model_in.Clone()
# clone its elements to avoid side effects
# clone the feb-model to avoid side effects

deform = feb.Deform(model.febmodel)
response = feb.Response(deform)

# calculate the displacements
# calculate the member forces

# if something changed inform the feb-model about it (otherwise it won't recalculate)

lc = 0
energy_visitor = feb.EnergyVisitor(model.febmodel, model.febmodel.state(0), lc);
elastic_E = energy_visitor.elasticEnergy()

max_displ = response.maxDisplacement()

The Results Retrieval example above uses the feb library’s classes like feb.Deform, feb.Response, and feb.EnergyVisitor to access the model’s results. However, the feb library seems to be a C++ backend (I can’t use inspection to probe its attributes and functions) and its API is not documented at the SDK manual.

I wonder if we can have the API of feb documented in the SDK as well? And in a shorter term, can we also have a scripting example demonstrating how we can retrieve the data that we can get from the Utilization of Elements component, in C+ or IronPython?

Thanks again for making and maintaining such a great plugin!


Hi @yijiang94817,

I will try to setup an example regarding the element utilizations.

The problem with the API of the C++ Karamba3D library is, that it is still in development. So new versions of Karamba3D would very likely break the functionality of plug-ins which directly depend on it. In order to stay flexible with the development of the C++ API I therefore refrained from publishing a corresponding documentation so far.
– Clemens

Hi @yijiang94817,
I setup an example where beam utilization values according to EC3 get retrieved via script: (23.6 KB). In the next K3D release it can be found in the installation folder under ‘Examples/TestExamples/Scripts/’.
I hope this helps.
– Clemens

Hi @cp1,

This is exactly what I need! Thank you very much!