Assign transverse heavy axle to line

Hello everyone,

I am creating parameterized timber hall systems using the RFEM 6 API. For this, I want to implement new different distribution types for beams (Uniform, Linear, Gable, etc.).
Now to my problem with the implementation.
I create my frame according to the code (Attachment 1). Accordingly, I assign my members to a previously defined line – i.e., my nodes for the support heads and the nodes of the main beam are identical. However, as soon as I no longer distribute the cross-section uniformly but change it to, for example, "Linear," the system line is recalculated at the end due to the changed cross-section. As a result, the system line of the beam no longer reaches the head node of the support (see image – top right).
My cross-sections are created as follows depending on the selection option (Attachment 2).

How do I appropriately proceed here to specify when defining the beam that its centroidal axis is always defined on the assigned line, regardless of the cross-section distribution type, or are there perhaps other approaches to solve the problem described?

Thank you very much in advance!


ATTACHMENT 1:


// =====================================================================================
// NODES (Horizontal beam at height "Frame_MinHeight")
// =====================================================================================
FullFrame.Add(new RFEM.StructureCore.Node { No = 1, Coordinate1 = parameter_Structure.Frame_Width * 0.5 }); // Bottom Right
FullFrame.Add(new RFEM.StructureCore.Node { No = 2, Coordinate1 = parameter_Structure.Frame_Width * 0.5, Coordinate3 = -parameter_Structure.Frame_MinHeight }); // Top Right (Eaves)
FullFrame.Add(new RFEM.StructureCore.Node { No = 3, Coordinate1 = -parameter_Structure.Frame_Width * 0.5, Coordinate3 = -parameter_Structure.Frame_MinHeight }); // Top Left (Eaves)
FullFrame.Add(new RFEM.StructureCore.Node { No = 4, Coordinate1 = -parameter_Structure.Frame_Width * 0.5 }); // Bottom Left

// =====================================================================================
// LINES
// =====================================================================================
FullFrame.Add(new RFEM.StructureCore.Line { No = 1, DefinitionNodes = { 1, 2 } }); // Right Support
FullFrame.Add(new RFEM.StructureCore.Line { No = 2, DefinitionNodes = { 3, 2 } }); // Main Beam (Horizontal from left to right)
FullFrame.Add(new RFEM.StructureCore.Line { No = 3, DefinitionNodes = { 4, 3 } }); // Left Support

// =====================================================================================
// DEFINE MEMBERS
// =====================================================================================
var supportRight = new RFEM.StructureCore.Member
{
No = 1,
Line = 1,
CrossSectionStart = CrossSectionManager.Id_SupportY,
Type = RFEM.StructureCore.Member.Types.Type.Beam,
Comment = "Support Right",
TimberServiceClass = GetNklId(parameter_CrossSection.NKL_SupportFrame)
};

var supportLeft = new RFEM.StructureCore.Member
{
No = 3,
Line = 3,
CrossSectionStart = CrossSectionManager.Id_SupportY,
Type = RFEM.StructureCore.Member.Types.Type.Beam,
Comment = "Support Left",
TimberServiceClass = GetNklId(parameter_CrossSection.NKL_SupportFrame),

};

var beam = new RFEM.StructureCore.Member
{
No = 2,
Line = 2,
Type = RFEM.StructureCore.Member.Types.Type.Beam,
Comment = "Main Beam (Horizontal system axis)",
TimberServiceClass = GetNklId(parameter_CrossSection.NKL_MainBeam),
};


ATTACHMENT 2


// ==========================================
// 3. MAIN BEAM (Dynamic depending on type) -> Material 2
// ==========================================
Id_MainBeamStart = currentNo++;

// Determine start height (eaves height for special forms such as gable/shed roof beams)
double hStart = 0;
if (pc.MainBeam_DistributionType == "Uniform") hStart = pc.MainBeam_Height;
else if (pc.MainBeam_DistributionType == "Linear (Voute)") hStart = pc.MainBeam_HeightStart;
else hStart = pc.MainBeam_HeightEaves; // Gable and shed roof beams

crossSections.Add(new RFEM.StructureCore.CrossSection
{
No = Id_MainBeamStart,
Material = 2,
Name = System.FormattableString.Invariant($"R_M1 {pc.MainBeam_Width / 1000.0}/{hStart / 1000.0}")
});

// If not uniform, create the END cross-section (or first cross-section)
if (pc.MainBeam_DistributionType != "Uniform")
{
Id_MainBeamEnd = currentNo++;

  double hEnd = 0;
  if (pc.MainBeam_DistributionType == "Linear (Voute)") hEnd = pc.MainBeam_HeightEnd;
  else hEnd = pc.MainBeam_HeightFirst; // Gable and shed roof beams

  crossSections.Add(new Rfem.StructureCore.CrossSection
  {
      No = Id_MainBeamEnd,
      Material = 2, // Same material as start
      Name = System.FormattableString.Invariant($"R_M1 {pc.MainBeam_Width / 1000.0}/{hEnd / 1000.0}")
  });

}
else
{
// Fallback for uniform: end ID is the same as start ID
Id_MainBeamEnd = Id_MainBeamStart;
}

Hi MarcelFE1,

before we get to the actual problem, a small tip about posting code. If you frame it like this, the formatting is not lost. For example:

And this is the result:

using System;

class Program {
    static void Main() {
        Console.WriteLine("Hello World");
    }
}

Now to your actual problem. The easiest way is to try the necessary settings in the UI. Did you model the frame there in both ways, and what did you have to change? The respective models can be exported as Python code and then the settings can be analyzed. I know you are working with C#, but the Python code should be informative enough for that. An export to C# is not possible.

If you do not achieve the desired result this way, please send me both RFEM models, and I will take a closer look at them.

Happy coding.

Best regards
Robert Milrath

Thank you very much for your response. It was helpful to me!