| RemoveObjects[class] removes all objects listed by Objects[class], while RemoveObjects[class, All] also includes objects of all subclasses. Scan[RemoveObjects, Descendants[Object]] removes all objects (RemoveObjects[] is not defined in order to avoid accidential removal). |
This loads the package.
Let us first create a simple base class and a child class.
This generates some objects.
The objects are held in a list and can be removed without holding explicit references. The last line also lists the objects that have the given class as superclass. The next example recreates some base objects and includes all subclasses |