You may be able to save multiple meshes, parented to a pivot when you use the correct structure (nested nodes maybe), but I never really managed it to do this myself, tho I didn't try hard.
If you want to use my code, all you have to do is adding everything together to a single mesh. (and of course, the code expects a texture for every brush, you may edit the source, it's easily possible to make it use a color only, tho what map would use colors instead of textures?)
so you should use AddMEsh to add everything together to a single mesh that was initially created using CreateMEsh().
If you use AddMesh, you sould not use PositionEntity, Rotateentity, Scaleentity or EntityTexture, instead use its Mesh-Counterparts: PositionMEsh, RotateMesh, ScaleMesh and PaintMesh.
If you use copies of the original individual Meshes, and use their (Entity-) Rotation, Position etc. values with RotateMesh, PositionMesh etc., you'll be able to continue working with the level (in a non-degenerative way) after saving it / collapsing their copies.
If you want to use my code, all you have to do is adding everything together to a single mesh. (and of course, the code expects a texture for every brush, you may edit the source, it's easily possible to make it use a color only, tho what map would use colors instead of textures?)
so you should use AddMEsh to add everything together to a single mesh that was initially created using CreateMEsh().
If you use AddMesh, you sould not use PositionEntity, Rotateentity, Scaleentity or EntityTexture, instead use its Mesh-Counterparts: PositionMEsh, RotateMesh, ScaleMesh and PaintMesh.
If you use copies of the original individual Meshes, and use their (Entity-) Rotation, Position etc. values with RotateMesh, PositionMesh etc., you'll be able to continue working with the level (in a non-degenerative way) after saving it / collapsing their copies.