TimberModel.add_element

TimberModel.add_element(element, parent=None, material=None)[source]

Add an element to the model.

Parameters:
elementElement

The element to add.

parentGroupNode, optional

The parent group node of the element. If None, the element will be added directly under the root node.

materialMaterial, optional

A material to assign to the element. Note that the material should have already been added to the model before it can be assigned.

Returns:
Elementnode

The tree node containing the element in the hierarchy.

Raises:
ValueError

If the parent node is not a GroupNode.

ValueError

If a material is provided that is not part of the model.