I just thought of a much easier way.
For the main cube, just make the mesh set-able. So, the main parent doesn’t have a mesh set. Then you can set the mesh and in the children.
Cube mesh for the cubes, pipe for the pipes etc.
But don’t worry too much about it. If you want to try it out, make a copy of the project. If you can get it working there, then delete the first one and carry on with the new one.