Create stiffness rods between (two) nodes

Hello, I want to create a stiffness member via API. My current code runs without errors, but no member is created, or I don't see one in the model; please help.

Excerpt from the current Python code (NodeNo_Untergurt is transferred from Matlab to Python):

==========================================================

# CREATE MEMBERS BETWEEN EXISTING NODES
# ==========================================================

members = []

member_start_no = 1000

for i, (n1, n2) in enumerate(
    zip(NodeNo_Untergurt[:-1], NodeNo_Untergurt[1:])
):

    member = Member()
    member.no = member_start_no + i
    member.node_start = int(n1)
    member.node_end = int(n2)

    members.append(member)


rstab_app.create_object_list(members)


# ==========================================================
# CREATE MEMBER DEFINABLE STIFFNESS
# ==========================================================

stiff = MemberDefinableStiffness()

stiff.no = 1000

stiff.assigned_to.extend(
    [m.no for m in members]
)

stiff.axial_stiffness = 1000
stiff.bending_stiffness_y = 1000
stiff.bending_stiffness_z = 1000
stiff.shear_stiffness_z = 1000
stiff.torsional_stiffness = 0


rstab_app.create_object(stiff)

Hi alex.muellner,

can you please send me a simple RSTAB model that contains the desired result?

Best regards
Robert Milrath

Hello Robert, thanks for the feedback, attached is an example with a stiffness rod between two nodes. The rod also has a joint at the endpoint, which I would like to add, but it is not yet considered in my current code.
Best regards, Alex Müllner
Minimalbeispiel_Steifigkeitsstab.rs9 (887.5 KB)

Hi alex.muellner,

I opened the script in RFEM and then exported it into a Python script. There is an FAQ for this Generating example files for using objects in the API (gRPC).

I had to make a few minor adjustments, RFEM is not RSTAB after all, but that was done quickly.

The export function is currently only available in RFEM, but it has already been requested for RSTAB as well. I had you added to the list of interested parties (RUS ID = 5927).

"""
Model name: Minimalbeispiel_Steifigkeitsstab
Project name: Downloads
Program: RSTAB 9
dlubal.api: 2.15.3
"""

from math import inf, nan
from dlubal.api import rstab, common

# Connect to the RSTAB application
with rstab.Application(port=9002) as rstab_app:

    # Create new empty model
    rstab_app.create_model(name="Minimalbeispiel_Steifigkeitsstab_Exported")

    # Set global model settings:
    base_data = rstab_app.get_base_data()

    base_data.general_settings.tolerance_for_nodes = 0.000500000023748726
    base_data.general_settings.tolerance_for_lines = 0.000500000023748726
    base_data.general_settings.tolerance_for_planes = 0.000500000023748726
    base_data.general_settings.tolerance_for_directions = 0.000500000023748726
    base_data.combinations_settings.combination_wizard_active = True
    base_data.main.model_type = rstab.BaseData.Main.MODEL_TYPE_2D_XZ

    rstab_app.set_base_data(base_data=base_data)

    # Cleanup the model
    rstab_app.delete_all_objects()

    # Define list of model objects to be created
    object_list = [
        # Materials
        rstab.structure_core.Material(
            no=1,
            user_defined_name_enabled=False,
            name="S235 | EN 1993-1-1:2005-05",
        ),

        # Nodes

        # Node
        rstab.structure_core.Node(
            no=1,
        ),

        # Node
        rstab.structure_core.Node(
            no=2,
            coordinate_1=1,
        ),

        # Members

        # Member
        rstab.structure_core.Member(
            no=1,
            type=rstab.structure_core.Member.TYPE_DEFINABLE_STIFFNESS,
            node_start=1,
            node_end=2,
            member_type_definable_stiffness=1,
            member_hinge_end=1,
        ),

        # Nodal Supports
        rstab.types_for_nodes.NodalSupport(
            no=1,
            user_defined_name_enabled=True,
            name="Articulated",
            spring=common.Vector3d(x=inf, y=0, z=inf),
        ),
        rstab.types_for_nodes.NodalSupport(
            no=2,
            user_defined_name_enabled=True,
            name="Fixed",
            spring=common.Vector3d(x=inf, y=0, z=inf),
            rotational_restraint=common.Vector3d(x=0, y=inf, z=0),
        ),
        rstab.types_for_nodes.NodalSupport(
            no=3,
            user_defined_name_enabled=True,
            name="Slidable",
            spring=common.Vector3d(x=0, y=0, z=inf),
        ),

        # Member Hinges
        rstab.types_for_members.MemberHinge(
            no=1,
            axial_release_n=inf,
            axial_release_vz=inf,
        ),

        # Member Definable Stiffnesses
        rstab.types_for_members.MemberDefinableStiffness(
            no=1,
            name="EI_y : 1000.00 kNm^2 | EA : 1000.000 kN | GA_z : 1000.000 kN (Members : 1)",
            torsional_stiffness=0,
            bending_stiffness_y=1000000,
            bending_stiffness_z=0,
            axial_stiffness=1000000,
            shear_stiffness_y=0,
            shear_stiffness_z=1000000,
            specific_weight=0,
            section_area=0,
            rotation=0,
            thermal_expansion_alpha=0,
            thermal_expansion_width=0,
            thermal_expansion_height=0,
        ),

        # Building Grids
        rstab.guide_objects.BuildingGrid(
            no=1,
            coordinates_list_x="0.000 6*10.000",
            origin_coordinates=common.Vector3d(x=-30, y=0, z=0),
        ),
        rstab.guide_objects.BuildingGrid(
            no=3,
            grid_type=rstab.guide_objects.BuildingGrid.GRID_TYPE_CYLINDRICAL,
            coordinates_list_x="0.000 3*10.000",
        ),

        # Actions

        # Action
        rstab.loading.Action(
            no=1,
            name="Permanent",
            action_category=rstab.loading.Action.ACTION_CATEGORY_PERMANENT_G,
            items=rstab.loading.Action.ItemsTable(
                rows=[
                    rstab.loading.Action.ItemsRow(load_case_item=1),
                ]
            ),
        ),

        # Load Cases
        rstab.loading.LoadCase(
            no=1,
            name="Self-weight",
            static_analysis_settings=1,
        ),

        # Design Situations
        rstab.loading.DesignSituation(
            no=1,
            name="ULS (STR/GEO) - Permanent and transient - Eq. 6.10",
            design_situation_type=rstab.loading.DesignSituation.DESIGN_SITUATION_TYPE_STR_PERMANENT_AND_TRANSIENT_6_10,
            combination_wizard=1,
        ),
        rstab.loading.DesignSituation(
            no=2,
            name="SLS - Characteristic",
            design_situation_type=rstab.loading.DesignSituation.DESIGN_SITUATION_TYPE_SLS_CHARACTERISTIC,
            combination_wizard=1,
        ),
        rstab.loading.DesignSituation(
            no=3,
            name="SLS - Frequent",
            design_situation_type=rstab.loading.DesignSituation.DESIGN_SITUATION_TYPE_SLS_FREQUENT,
            combination_wizard=1,
        ),
        rstab.loading.DesignSituation(
            no=4,
            name="SLS - Quasi-permanent",
            design_situation_type=rstab.loading.DesignSituation.DESIGN_SITUATION_TYPE_SLS_QUASI_PERMANENT,
            combination_wizard=1,
        ),

        # Static Analysis Settings
        rstab.loading.StaticAnalysisSettings(
            no=1,
        ),
        rstab.loading.StaticAnalysisSettings(
            no=2,
            analysis_type=rstab.loading.StaticAnalysisSettings.ANALYSIS_TYPE_SECOND_ORDER_P_DELTA,
        ),
        rstab.loading.StaticAnalysisSettings(
            no=3,
            analysis_type=rstab.loading.StaticAnalysisSettings.ANALYSIS_TYPE_LARGE_DEFORMATIONS,
        ),

        # Combination Wizards
        rstab.loading.CombinationWizard(
            no=1,
            static_analysis_settings=2,
            consider_imperfection_case=True,
        ),
        rstab.loading.CombinationWizard(
            no=2,
            static_analysis_settings=1,
        ),
    ]

    rstab_app.create_object_list(object_list)

Best regards Robert Milrath