I’m working with the RFEM6 Python API II and need to modify only the specific weight (γ) and mass density (ρ) of an existing concrete material. I understand that these properties live in the material’s temperature‐dependent row table, but I haven’t found a concise, reliable approach to update just those two fields without re‑defining the entire material.
Here’s what I’ve tried so far:
Create a brand‑new Material object matching the enums of the original (model, type, definition), then force is_temperature_dependent = True, add or reuse the first temperature row, and override its specific_weight and mass_density before pushing via create_object_list().
Deep‑copy the original Material, change its no and name, enable temperature dependence, update the first temperature row, and push the copy back.
In both cases, logging before and after showed that the new row values never “stick” once the model is reloaded. I also verified I’m targeting row 1 for both weight and density, but still end up with the original values.
thanks for bringing this up!
We are aware of this limitation and are currently working on a solution. Unfortunately, there is no straightforward workaround at the moment. However, we plan to make it possible to update an existing material—including specific weight and mass density—or to create a deep copy with modified properties in a future update.
I’ll keep you posted as soon as this becomes available.
Ok thanks very much for letting me know!
I work off a template model so I think in the mean time it will work to just use the UI to copy the most common concrete's I tend to use and manually change the values I need, note the corresponding material numbers in python and just assign materials rather than trying to modify :)
Just wanted to let you know that the issue has already been solved in version 6.11.0011/2.11.11, and no workaround is necessary anymore. You can directly update the material properties, such as mass density and specific weight, using the following approach:
But then got "Failed to create Material No. 3. Material No. 3 does not have the property user_material_guid."
Is the guid meant to be created manually by me like above, or what code should it be?
In Material — Dlubal API documentation it says its User Material Guide so not sure if its meant to be a global unique identifier or something else? It just says string so I’m assuming guide is a misspelling and it is a guid? But I would expect the api to generate it rather than me making it, and given I’m getting an error I think I am intepreting it wrong.
I saw that in the latest update 6.12.0010 there were the following developments
Modify Material Design Values and Allow Getting/Updating Material Properties Independent of Temperature (both for 81.12 API – gRPC Server)
So I updated and tried again but I still get the error I described in my previous comment
Is there any guidance about how to update my code for the new version?
I’ve also noticed after looking more into the api docs to help figure this out that under User-defined Material — Dlubal API documentation it doesn’t have anything with guid so I couldn’t get any additional info from this.
Sorry for the delayed response. I would try to modify your code in the following manner:
from dlubal.api import rfem, common
with rfem.Application() as rfem_app:
mat_3 = rfem_app.get_object(rfem.structure_core.Material(no=2))
print(mat_3.material_values.rows[0])
mat_prop = rfem.structure_core.Material.MaterialValuesRow.MaterialValuesTreeTable()
common.set_tree_value(mat_prop, ['basic_properties', 'rho'], 2400.0) # mass density
common.set_tree_value(mat_prop, ['basic_properties', 'gamma'], 24000.0) # specific weight
mat_3.material_values.rows[0].material_values_tree.CopyFrom(mat_prop)
rfem_app.update_object(
rfem.structure_core.Material(
no=2,
user_defined=True,
material_values=mat_3.material_values
)
)
Hopefully, this will help for now. As for TreeTables in general, we're still working on improvements and simplifications. For example, we're exploring ways to modify the original TreeTable directly instead of creating a new one with just the modifications. Stay tuned, and sorry that the API is still a bit live.