Looking for an algorithm/approach

Is there an algorithm or a particular approach to take this:

Getting as result only the boxes that are closed. The smallest possible, such that they do not contain any surface inside them.

Similar to the command: CreateSolid but not just the one.

Thanks in advance.

Just saw CreateSolid actually creates what I want lol.
Is there something similar in Grasshopper?