580x
005367
2023-03-23

Reading out Nodal Deformation with Python

How can I read out the deformation at a certain node using the Python program?


Answer:

In the example program, a cantilever is initially created from IPE 200. This is subjected to a member load of 3.5 kN and the calculation is carried out.

This table is accessed on Line 34:

The ResultTables.NodesDeformations() method requires three arguments. First, determine which type of results are to be read out. These can be the results of

  • Load cases
  • Load combinations
  • Result combinations
  • Design situations
  • Construction stages

sein.

Second, specify the number of the load case, load combination, and so on. Finally, transfer the node number to the method.

The return value d of the method is a list included in the dictionary. On Line 37, d is displayed completely. Line 40 shows how to access a specific value. [0] is the list index and ['displacement_z'] is the key of the dictionary.


            

from RFEM.enums import *
from RFEM.initModel import *
from RFEM.BasicObjects.material import Material
from RFEM.BasicObjects.section import Section
from RFEM.BasicObjects.node import Node
from RFEM.BasicObjects.member import Member
from RFEM.TypesForNodes.nodalSupport import NodalSupport
from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings
from RFEM.LoadCasesAndCombinations.loadCase import LoadCase
from RFEM.Loads.memberLoad import MemberLoad
from RFEM.Results.resultTables import ResultTables

Model(True, "Beam.rf6")
Model.clientModel.service.delete_all()
Model.clientModel.service.begin_modification()

Material(1, 'S235')
Section(1, 'IPE 200')

Node(1, 0.0, 0.0, 0.0)
Node(2, 5.0, 0.0, 0.0)

Member.Beam(1, 1, 2, start_section_no=1, end_section_no=1)

NodalSupport(1, '1', NodalSupportType.FIXED)

StaticAnalysisSettings.GeometricallyLinear(1, "Linear")
LoadCase(1, 'Load', [True, 0.0, 0.0, 1.0])

MemberLoad(1, 1, '1', magnitude=3500)

Calculate_all()

d = ResultTables.NodesDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 1, 2)

# all:
print(d)

# displacement in Z
print(d[0]['displacement_z'])

Model.clientModel.service.finish_modification()



Author

Mr. Faulstich is responsible for the quality assurance of the RFEM program and provides customer support.