Create a Load case from Load combination

Hi,

I wanted to create a modal load case from a load combination.
But the "import masses only from .. " option defaults to load case 1
I guess the problem lies on the unavailability of the load combinations.
But it occurs even if, I create the modal load case after running the analysis and the combinations are available.
Another problem is even if i changed the option manually, it gets replaced again when creating additional load cases.
Thanks for your support.
Find the code snippet here

def define_modal_analysis() -> list:
 
    return [
    
 
        # define modal analysis setting
        rfem.loading.ModalAnalysisSettings(
             no=3, # 1 and 2 get created automatically
             #defining the name parameter causes errors.
             number_of_modes=11,
             number_of_modes_method=rfem.loading.ModalAnalysisSettings.NumberOfModesMethod.NUMBER_OF_MODES_METHOD_USER_DEFINED,
             solution_method=rfem.loading.ModalAnalysisSettings.SolutionMethod.SOLUTION_METHOD_LANCZOS,
             mass_matrix_type=rfem.loading.ModalAnalysisSettings.MassMatrixType.MASS_MATRIX_TYPE_CONSISTENT,
             acting_masses_about_axis_x_enabled=False,
             acting_masses_about_axis_y_enabled=False,
             acting_masses_about_axis_z_enabled=True,
             acting_masses_in_direction_x_enabled=True,
            acting_masses_in_direction_y_enabled=True,
            acting_masses_in_direction_z_enabled=True,

        ),

      
        
        # modal analysis
        rfem.loading.LoadCase(
            no=3,
            analysis_type=rfem.loading.LoadCase.AnalysisType.ANALYSIS_TYPE_MODAL_ANALYSIS,
            modal_analysis_settings=3,
            import_masses_from=rfem.object_id_pb2.ObjectId(no=5,object_type=rfem.ObjectType.OBJECT_TYPE_LOAD_COMBINATION),
            structure_modification_enabled=True,
            structure_modification=1
        ),

    ]

Hi Mesay,

I was able to replicate the issue. We will start working on a fix and keep you updated.

Thanks for reporting it!

Best regards,

Hi Mesay,

In the released versions 6.11.0011/2.11.11, the issue you encountered has been resolved. Firstly, it's important to highlight that when a Load Case (LC) is created, all automatically generated Load Combinations are deleted. To overcome this, you can simply regenerate the combinations after creating the Load Case.

Additionally, the updated version now allows you to update the Load Case and set the import_masses_from property to a specific Load Combination without any errors.

Here’s an updated example for how to handle this:

# Create Load Case (LC) for modal analysis
rfem_app.create_object(
    rfem.loading.LoadCase(
                no=7,
                analysis_type=rfem.loading.LoadCase.AnalysisType.ANALYSIS_TYPE_MODAL_ANALYSIS,
                modal_analysis_settings=4,
    )
)

# IMPORTANT: Automated combinations are deleted when a Load Case (LC) is created, so we need to regenerate them.
# After generating combinations, assign the specific combination for masses to LC manually.

rfem_app.generate_combinations()

# Retrieve the created Load Case (LC) number 7
lc_7: rfem.loading.LoadCase = rfem_app.get_object(
    rfem.loading.LoadCase(no=7)
)

# Assign masses from a specific Load Combination (LC) number 2
lc_7.import_masses_from.no = 2
lc_7.import_masses_from.object_type = rfem.ObjectType.OBJECT_TYPE_LOAD_COMBINATION

# # Alternative approach to import masses from Load Combination into Load Case
# lc_object_id = rfem.ObjectId(
#     no=2,  # Load Combination number
#     object_type=rfem.ObjectType.OBJECT_TYPE_LOAD_COMBINATION  # Specify the object type
# )
# lc_7.import_masses_from.CopyFrom(lc_object_id)  # Copy masses from LC using ObjectId

rfem_app.update_object(lc_7)

I hope this helps! Feel free to reach out if you encounter any other issues.

Best regards,