Model.add_element

Model.add_element(element, parent=None)

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.

Returns:
Elementnode

The tree node containing the element in the hierarchy.

Raises:
ValueError

If the parent node is not a GroupNode.