Get volume API

Hello

I’d like to know if you can help me with the following: I want to write code that generates components that correspond to the volume of a model. This volume is the void located between several panels, as shown in the image. The code must generate all the voids (volumes found in the selection) and create a component for each one, along with its position and corresponding axes. Within the initial selection, there are solid components that are not grouped or nested within each other; they are all loose and in contact with each other. The question is, is this possible? And if so, what points should I keep in mind to start as a guide and not die trying.

Thank you very much

Please clarify (attaching an example skp rather than an image would help). It’s not clear to me just what you are starting from. For example, are the Faces that form candidate floors, walls and ceilings of your rooms all contained in ComponentInstances, or are they loose, or a mix of the two? This is important because unless the existing components are non-solid (that is, missing some required surfaces), you can just use the volume method on them.

Edit: Also for rectangular parallelopipeds such as in your image it is very easy to test for missing faces and fill them in to produce solids.

Hello
Thanks for responding. I’m attaching the volume.skp file from which I want to get the volumes in pink in the image.

Thanks.
volume.skp (227.0 KB)