Hello!
I am modelling a laterally loaded pile for my master thesis and plan to introduce an initial imperfection manually using the proposed buckling curves. For this, I need to define the relevant material and section properties. My question is whether it is possible to extract material or geometric data directly from an already defined material or cross‑section in the model and where I can read on this. For example, I would like to retrieve the elastic modulus and the second moment of inertia as float values.
A snippet from my code (the nodals is under construction):
# ============================================================
# STRUCTURE OBJECTS
# ============================================================
material: rfem.structure_core.Material = rfem.structure_core.Material(
no=1,
name="S235"
)
cross_section: rfem.structure_core.CrossSection = rfem.structure_core.CrossSection(
no=1,
name="CHC 508.0x12.5",
material=1,
)
nodes = []
for i in range(n_nodes):
rfem_app.get_object(
rfem.structure_core.
)
L_g = (4*E*I_y/K_u)**(1/4)
z = i * length / n_elem
x = u0 * e**(-z/(sqrt(2)*L_g))*(cos((sqrt(3/2)*z)/L_g)-(1/sqrt(3))*sin((sqrt(3/2)*z)/L_g))
nodes.append(
rfem.structure_core.Node(
no=i + 1,
coordinate_3=z
)
)
Thanks in advance
Hi studentlnu11,
All objects, including materials and cross-sections, can be modified via the API. To do this, you can modify the properties using update_object_list for multiple objects or update_object for a single object. Of course, the object must already exist in the Dlubal app.
- If necessary, create the object with the required parameters (if the object does not yet exist in the dlubal app).
- Retrieve the object with get_object / get_object_list. All parameters are then assigned the default values.
- Make changes to the object
Note: Using get_object and update_object in a loop leads to high request counts, so it is better to work with get_object_list or update_object_list.
I hope that helps.
Best regards
Robert Milrath
Hi, and thanks for the response.
My aim is to be able to extract the relevant properties (EI in this case) directly from an already defined cross‑section or material without manually go in and check it.
Procedure:
Create object: material and cross section --> Get E and I_y as a float number
Hi studentlnu11,
without a request you'll not have all values available.
The API uses protobuf messages. Your local material only contains fields you explicitly set.
When you call create_object_list(...), the server may add defaults, computed values, or IDs. The local protobuf instance is not automatically updated with those server-side changes.
To get the server-side/full object you must request it (e.g. get_object(...)) .
Happy coding.
Best regards
Robert Milrath
1 Like