RFEM6 API II PYTHON | NodalLoad with has_specific_direction

Hi,

I'm trying to create horizontal nodal loads using the RFEM 6 Python API with has_specific_direction=True and SPECIFIC_DIRECTION_TYPE_ROTATED_VIA_3_ANGLES. The loads are being created successfully (no errors), but they appear in RFEM with zero magnitude and the "Specific Direction" checkbox is unchecked.

Working Method:

The LOAD_TYPE_COMPONENTS approach works perfectly - loads appear with correct magnitudes and directions.

Non-Working Method:

The has_specific_direction approach creates loads but they show as zero magnitude in RFEM.

Code Example:

# This works - loads appear correctly

objects.append(

rfem.loads.NodalLoad(

load_case=case_no,

nodes=[center_node_no],

load_type=rfem.loads.NodalLoad.LOAD_TYPE_COMPONENTS,

coordinate_system=3,  # Plate Load Axis

components_force_x=h_x_component,

components_force_y=h_y_component,

components_force_z=0.0,

)

)

# This doesn't work - loads appear with zero magnitude

objects.append(

rfem.loads.NodalLoad(

load_case=case_no,

nodes=[center_node_no],

load_type=rfem.loads.NodalLoad.LOAD_TYPE_FORCE,

coordinate_system=3,  # Plate Load Axis

has_specific_direction=True,

specific_direction_type=rfem.loads.NodalLoad.SPECIFIC_DIRECTION_TYPE_ROTATED_VIA_3_ANGLES,

axes_sequence=rfem.loads.NodalLoad.AXES_SEQUENCE_XYZ,

rotated_about_angle_1=0.0,  # U = 0°

rotated_about_angle_2=0.0,  # V = 0°

rotated_about_angle_3=h_angle,  # W = angle

load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_LOCAL_X,  # U direction

force_magnitude=h_magnitude,  # This shows as 0 in RFEM

)

)

Debug Information:

  • Unit conversion: h_magnitude = h_force * 1000.0 (kN → N)

  • Magnitude values are correct in Python (e.g., 100000.0 N)

  • Loads are created without errors

  • RFEM calculation does not run due to loads with 0 magnitude

  • The issue is specifically with the has_specific_direction parameters (it is unchecked in the model)

Manual RFEM Setup (that works):

  • Coordinate System: 3 (Plate Load Axis)

  • Load Direction: U (Local X)

  • Specific Direction: ✓ (checked)

  • Type: Rotated via 3 angles

  • Sequence: X/Y/Z

  • U = 0°, V = 0°, W = angle

  • Force magnitude: non-zero value

Question:

What is the correct way to set up has_specific_direction nodal loads via the Python API? Are there additional required parameters or a different approach needed?

Environment: 6.11.0004

Hi Samuel,

This issue is caused by certain attributes being temporarily locked by the context, preventing them from being set correctly. A fix is currently in progress, where an updated writing procedure will allow seamless modification of these locked attributes.

As a temporary workaround, you can skip setting has_specific_direction=True, and your code should work as expected without issues.

Best regards,

1 Like

Thank you so much for the advice that worked!

Samuel

1 Like

Hi Tomas,

After your suggestion, as mentioned before I was able to get my code to work as shown below.

# Method 2: Use specific direction without has_specific_direction (RFEM forum fix)
# RFEM API expects radians for rotated_about_angle parameters
slew_angle_rad = math.radians(slew_angle)
logger.debug(f"Slew specific direction method: angle={slew_angle}°, magnitude={slew_magnitude:.1f} N")
logger.debug(f"  Fixed approach: CS=3, LOCAL_X, rotated_about_angle_1=0°, rotated_about_angle_2=0°, rotated_about_angle_3={slew_angle}°")
logger.debug(f"  [RFEM API DEBUG] rotated_about_angle_3 value being sent to RFEM: {slew_angle_rad} radians (converted from {slew_angle}°)")

objects.append(
  rfem.loads.NodalLoad(
    no=load_no,
    load_case=case_no,
    nodes=[center_node_no],
    load_type=rfem.loads.NodalLoad.LOAD_TYPE_FORCE,
    coordinate_system=3,  # Plate Load Axis (User-defined coordinate system)
    specific_direction_type=rfem.loads.NodalLoad.SPECIFIC_DIRECTION_TYPE_ROTATED_VIA_3_ANGLES,
    axes_sequence=rfem.loads.NodalLoad.AXES_SEQUENCE_XYZ,
    rotated_about_angle_1=0.0,  # U = 0°
    rotated_about_angle_2=0.0,  # V = 0°
    rotated_about_angle_3=slew_angle_rad,  # W = angle (in radians)
    load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_LOCAL_X,  # U direction
    force_magnitude=slew_magnitude,
    comment=f"SLEW-FIXED role={role} leg_idx={leg_idx} angle={slew_angle}°"
  )
)

load_no += 1
logger.debug(f"Created slew component load: role={role}, leg_idx={leg_idx}, magnitude={slew_magnitude} N, angle={slew_angle}°")

Now that I have upgraded to 6.11.0011 it is not working unfortunately. I get the following error:

2025-09-20 14:27:00 [ERROR] infrastructure.rfem_api.foundation.rfem6_foundation - Error in foundation model creation: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNKNOWN
        details = "Failed to create Nodal Load No. 6000 Parent No. 10.  Attribute 'load_direction' is invalid or incorrectly defined. Invalid value.
"
        debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"Failed to create Nodal Load No. 6000 Parent No. 10.  Attribute \'load_direction\' is invalid or incorrectly defined. Invalid value.\n", grpc_status:2, created_time:"2025-09-20T07:27:00.4277517+00:00"}"
>

I also tried adding back in has_specific_direction=True to see if that was what changed, but I still got the same error.

I checked the API documentation to see if anything had changed in this regard (NodalLoad — Dlubal API documentation) but the load direction looked the same. In my python IDE it is still registering LOAD_DIRECTOIN_LOCAL_X in blue so its there (previously when I have done an update the name of something changed so it went grey so I knew that was the issue, but just clarifying that isn’t the case here).

Interestingly though, the nodal load 6000 still showed up in rfem6 exactly as I want, but then obviously the code stopped and nothing further happened. So its working, but the api is saying it isn’t and stopping the code? (

Also note that in this case it looks like I don’t need this overkill approach of specific directions but in subsequent load cases it generates loads at 45 degree angles so its moreso for that)

I can message you my full log and file if that helps, just let me know :slight_smile:

The code ran no issues on previous versions so not sure whats changed, couldn’t find anything in the release notes or bug fixes that would be related (I believe it worked on .008 and .0010). I thought about going back to 0010 just to double check it works on that but I can’t be bothered to reinstall, plus I want to try out the new updating material properties and concrete design configs that have been implemented which are solutions to my other two posts :slight_smile:

Samuel

Hi Samuel,

It looks like the issue you're facing is due to not corresponding load direction constant. You can easily fix this by replacing 'LOAD_DIRECTION_LOCAL_X' with 'LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE_LENGTH'.

Here's how your code would look after the change:

objects.append(
  rfem.loads.NodalLoad(
    no=load_no,
    load_case=case_no,
    nodes=[center_node_no],
    load_type=rfem.loads.NodalLoad.LOAD_TYPE_FORCE,
    coordinate_system=3,  # Plate Load Axis (User-defined coordinate system)
    specific_direction_type=rfem.loads.NodalLoad.SPECIFIC_DIRECTION_TYPE_ROTATED_VIA_3_ANGLES,
    axes_sequence=rfem.loads.NodalLoad.AXES_SEQUENCE_XYZ,
    rotated_about_angle_1=0.0,  # U = 0°
    rotated_about_angle_2=0.0,  # V = 0°
    rotated_about_angle_3=slew_angle_rad,  # W = angle (in radians)
    load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE_LENGTH,  # Updated direction
    force_magnitude=slew_magnitude,
    comment=f"SLEW-FIXED role={role} leg_idx={leg_idx} angle={slew_angle}°"
  )
)

This should resolve the invalid load direction error you're seeing. Let me know if this works, or if you need further assistance!

Best regards,

Awesome that worked thanks!

1 Like