When using the update_concrete_material method using the newly updated material directly inside a cross section object will result in a (vague) error. E.g.:
mode = Model()
material = scia_model.update_concrete_material(
315, "C30/37", Concrete.ECPart.GENERAL, e_modulus=12000 * 1e6
)
cross_section = model.create_circular_cross_section('concrete_pile', material, pile_diameter)
model.generate_xml_input()
will result in the following error:
Exception: Input file could not be generated, please check your model
which is not very clear.
I found out that If you want this to work you have the change the snippet to this:
mode = Model()
material = scia_model.update_concrete_material(
315, "C30/37", Concrete.ECPart.GENERAL, e_modulus=12000 * 1e6
)
material = Material(material.object_id,material.name)
cross_section = model.create_circular_cross_section('concrete_pile', material, pile_diameter)
model.generate_xml_input()
Which I think is very strange. I assume that (as Concrete is not a subclass of Material) there is a check if the material is an instance of Material, and the xml generating is failing there?
Although this workaround works fine there are two things not that great: a. the error message is not informative. b. this should just work because the only thing you need for css creation is the name and object_id of the material.
I hope you can improve this.
Thanks,
Wichard