hello. i am trying to create a script that takes a existing model and applies some amount (the same for all beams) of longitutional and stirrup reinforcement to all beams in the model.
I wonder how this could be done in C# since the reinforcement is drawn by hand in FEM:
// EDIT BEAM
var reinforcement = FemDesign.Materials.MaterialDatabase.GetDefault().MaterialByName("B500B");
var diameter_16 = 0.016;
var cover = 0.025;
double st = 0;
double end = 2;
var point = new FemDesign.Geometry.Point2d(0,0);
var anchorLength = 0.8;
var wire = new Wire(diameter_16, reinforcement, WireProfileType.Ribbed);
var elements = new List<FemDesign.GenericClasses.IStructureElement> {};
// Loop through all bars in the model and add longitudinal reinforcement
for (int i = 0; i < model.Entities.Bars.Count; i++)
{
var beam = model.Entities.Bars[i];
var longbar = new LongitudinalBar(beam, point, anchorLength, anchorLength, st, end, false);
var arm_top = new LongitudinalBarReinforcement(beam, wire, longbar);
var arm_list = new List<BarReinforcement> { arm_top };
var reinfbar = FemDesign.Reinforcement.LongitudinalBarReinforcement.AddReinforcementToBar(beam, arm_list, true);
elements.Add(reinfbar);
}
var model1 = new Model(Country.DK, elements);
using (var connection = new FemDesignConnection(keepOpen: true))
{
connection.Open(model);
}
from your answer i wrote this. but the reinforcement is not transfered to the new model. is there an obvious reason why?
// script works. simple mistake. just needed to declare variables correctly
var model = new Model(Country.DK, elements);
using (var connection = new FemDesignConnection(keepOpen: true))
{
connection.Open(model);
}