API2: parametric flat bar creation lacking properties

as shown in the video, using API2.12.13 and RFEM6.12.0013, I create a member with a parametric cross-section FLAT 440/80/H, but the cross-sectional properties are missing and the cross-section is not valid.

IMessage message = new RFEMApi2.StructureCore.CrossSection()
{
No = cs.Number,
Name = cs.Name,
Material = cs.Number_material,
};

I then type in the same string for the name of the cross-section, and the GUI assigns the cross-sectional properties.

How can I trigger the assigning of the cross-sectional properties, when creating members using API2?

Hi PSA001,

you can create your modell in RFEM, and then export the Python code.

File => Export => Phython Script | Dlubal API | gRPC

Open the file in your IDE, and you can see how it should be used. If it doesn't work please send me an RFEM example and I'll have a deeper look.

Best regards
Robert Milrath

Hello PSA001,

To trigger the cross-sectional properties correctly when creating the member, here's the right code snippet:

var objectsToCreate = new List<Google.Protobuf.IMessage>
{
    new Rfem.StructureCore.Material
    {
        No = 1,
        Name = "S355"
    },
    new Rfem.StructureCore.CrossSection
    {
        No = 1,
        Material = 1,
        Type = Rfem.StructureCore.CrossSection.Types.Type.ParametricBars,
        Name = "FLAT 0.440/0.080/H"
    }
};
await rfemApp.create_object_list(objectsToCreate);

Let us know if this helps!