finesse.model.Model.add

Model.add(obj, *, unremovable=False)[source]

Adds an element (or sequence of elements) to the model - these can be ModelElement sub-class instances.

When the object is added, an attribute defined by obj.name is set within the model allowing access to the object just added via model.obj_name where obj_name = obj.name.

Parameters
objSub-class of ModelElement (or sequence of)

The object(s) to add to the model.

unremovablebool, optional

When True, this object will not be able to be removed from this model

Returns
elementModelElement

The object that was added

Raises
Exception

If the matrix has already been built, the component has already been added to the model or obj is not of a valid type.