from dlubal.api import rfem

def main():
    with rfem.Application() as rfem_app:
        """Define and return a list of reinforcement objects."""
        list_of_reinforcement = []
        surface_reinforcement = rfem.reinforcement.SurfaceReinforcement(
            no=1,
            material=3,
            surfaces=[4, 5],
            definition_type=rfem.reinforcement.SurfaceReinforcement.DEFINITION_TYPE_REBAR_2_LAYERS,
            orthogonal_rebar_diameter=0.01,
            orthogonal_rebar_spacing=0.2,
            comment='Slabs'
        )
        list_of_reinforcement.append(surface_reinforcement)
        surface_reinforcement = rfem.reinforcement.SurfaceReinforcement(
            no=2,
            material=3,
            surfaces=[1, 2, 3, 6],
            definition_type=rfem.reinforcement.SurfaceReinforcement.DEFINITION_TYPE_MESH,
            mesh_name="Q257A",
            comment='Walls'
        )
        list_of_reinforcement.append(surface_reinforcement)
        reinforcement_direction = rfem.reinforcement.ReinforcementDirection(
            no=2,
            reinforcement_direction_type=rfem.reinforcement.ReinforcementDirection.REINFORCEMENT_DIRECTION_TYPE_FIRST_REINFORCEMENT_IN_Y,
            surfaces=[4, 5],
        )
        list_of_reinforcement.append(reinforcement_direction)

        rfem_app.create_object_list(list_of_reinforcement)

if __name__ == '__main__':
    main()