Line loads in the local coordinate system of a line

Good day,

For my API program, it would be particularly practical if I could code line loads that refer to the local coordinate system of the line. In the API manual, I found the following command:

image

So initially, I wanted to code the following in my main program:

RFEM.loads.LineLoad(

                                            no=5,

                                            load_case=LC_counter,

                                            lines=[1826, 1825],

                                            magnitude = Vz_lineforce,

                                            load_type=rfem.loads.LineLoad.LOAD_TYPE_FORCE,

                                            load_distribution=rfem.loads.LineLoad.LOAD_DISTRIBUTION_UNIFORM,

                                            load_direction=rfem.loads.LineLoad.LOAD_DIRECTION_LOCAL_Z, 

                                        ),

image

Unfortunately, the code breaks after creating an “incorrect line load that refers to the global coordinate system” with the following error message:

image

I then tried the whole thing again in a test file with less complex programming code; here is the code:

RFEM.loads.LineLoad(

                                    no=1,

                                    load_case=4,

                                    lines=[1],

                                    magnitude = 10,

                                    load_type=rfem.loads.LineLoad.LOAD_TYPE_FORCE,

                                    load_distribution=rfem.loads.LineLoad.LOAD_DISTRIBUTION_UNIFORM,

                                    load_direction=rfem.loads.LineLoad.LOAD_DIRECTION_LOCAL_Z, 

                                )

image

What is interesting here is that no warnings appear in the terminal, but the generated loads are also incorrect and refer to the global coordinate system instead of the desired local Z-direction.

I would be very pleased to receive feedback on how to deal with this issue.

Best regards,

Nick Böttcher

Hi DeflectionPerfection,

can you please send me a small rf6-example to show exactly how it should look like? You can create it via the UI, I just want to make sure that I get it right.

Thank you.

Best regards
Robert Milrath

Okay so what am I aiming on is to add a Lineload acting in direction of the local z-achsis of Line nr 1. This should look like that:

I tried to make that possible by coding the following:

from dlubal.api import RFEM

import math

with RFEM.Application(api_key_value='ak-dfef78252cd0493bb1262f7ab63b1ca6391dddc1bea34758') as RFEM_app:

info = rfem_app.get_application_info()

print(f'Version: {info.name}')



rfem_app.get_active_model()     #loads the manual opened model into the here written script




lst = \[




            rfem.loading.LoadCase(

                                    no=4,

                                    static_analysis_settings=1,

                                ),



            rfem.loads.LineLoad(

                                    no=1,

                                    load_case=4,

                                    lines=\[1\],

                                    magnitude = 10,

                                    load_type=rfem.loads.LineLoad.LOAD_TYPE_FORCE,

                                    load_distribution=rfem.loads.LineLoad.LOAD_DISTRIBUTION_UNIFORM,

                                    load_direction=rfem.loads.LineLoad.LOAD_DIRECTION_LOCAL_Z,  

                                )

    \]

RFEM_app.create_object_list(lst)

RFEM_app.calculate_specific(

                            loadings=\[

                                rfem.ObjectId(

                                        no =4,

                                        object_type=rfem.OBJECT_TYPE_LOAD_CASE

                                    )

                                \],

                                skip_warnings=True)

They key point is here the load direction => the command im using is from you webpage here:

https://apidocs.dlubal.com/source/rst_objects/rfem/loads/line_load.html#rfem-loads-line-load-loaddirection

unluckily , when using the code it always occures that the line gets a load with load direction on global coordinate system.

Means in fact it looks like that:

also the attributes in the dialogue of the load shows that the used coordinate system isnt set on local…

On my huger model for which Im testing the command it is even worse, because the code doesn’t continue after adding the first load which i wanted to refeer to the local coordinate system.

There I want to code automatized Loads like the following:

sadly its only possible to add loads like shown in the following picture because of the same problem:

I also tried a different method by first creating new coordinate systems and use the

following code:

RFEM.loads.LineLoad(

                                            no=5,

                                            load_case=LC_counter,

                                            lines=\[1826, 1825\],

                                            coordinate_system = 3,

                                            magnitude = Vz_lineforce,

                                            load_type=rfem.loads.LineLoad.LOAD_TYPE_FORCE,

                                            load_distribution=rfem.loads.LineLoad.LOAD_DISTRIBUTION_UNIFORM,

                                            load_direction=rfem.loads.LineLoad.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_PROJECTED_LENGTH, 

                                        ),

Here i had the expectation that by the line => coordinate_system = 3

in combination with load_direction=RFEM.loads.LineLoad.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_PROJECTED_LENGTH,

that it will use the global U-axis to define the loads. But still the code crashes…

if you are able to create any code which applies line-loads to local axes (pls test it before sending me simple the codesnippets from your library i alredy tried before…)

it would be nice youpost them.

Optional a proper way of using self-made global axis-systems in the load direction of line loads would help me out.

Thank you.

best regards Nick

Hi DeflectionPerfection,

I have now created my own example in RFEM, and I used the export function to generate the Pyhton code for it. If you do the same, you'll get a full working example.

Generating Example Files for Using Objects in API (gRPC)

This is the exported py-code:
line_load_export.py (3.5 KB)

There you will find a line load with your desired settings.

rfem.loads.LineLoad(
    no=1,
    lines=[3],
    load_case=1,
    coordinate_system=common.CoordinateSystemRepresentation(
       type=common.CoordinateSystemRepresentation.COORDINATE_SYSTEM_TYPE_LOCAL
    ),
    magnitude=8000,
),

I hope this helps you.

Best regards
Robert Milrath

1 Like

Thank you very much for the response!

With this, you not only provided me with a top-notch code for the line load but also directly solved the problem with various other code snippets that use common… !!!

Also, the approach of being able to generate code from existing models is fantastic!!!

Thank you very, very much!!

Best regards

Nick Böttcher

2 Likes