purge_object

Project.purge_object(obj, deep=False)[source]

Removes an object from the Project. This removes all references to the object from all other objects (i.e. removes labels)

Parameters
  • obj (Base or list[Base]) – The object(s) to purge

  • deep (bool) – A flag that indicates whether to remove associated objects. If True, then removing a Geometry or Phase also removes the associated Physics objects. If False (default) then only the given object is removed, along with its labels in all associated objects. Removing a Physics always keeps associated Geometry and Phases since they might also be associated with other Physics objects.

Returns

Return type

None

Raises

An Exception is raised if the object is a Network.

Notes

For a clearer picture of this logic, type print(project.grid) at the console. A deep purge of a Geometry is like removing a row, while a Phase is like removing a column.