Here's some more work in progress, I might not get a chance to work on this for a few days and there are a couple of monstrous bugs that I need to resolve. The code is in the the Urb perl module (you will also need the latest File::DXF, File::IFC and Molior modules from the same place).
This is a mesh made up from vertical and horizontal quads, it is partitioned internally so it is non-manifold:

The urb-topologise.pl
script processes this as a DXF file (I really need a better way to do IO), identifies cells, storeys, generates graphs for walls, floors, room connectivity etc.. Then the molior-ifc.pl
tool is used to generate an IFC file for opening with blenderbim:
$ urb-topologise.pl t/data/non-manifold-1.dxf non-manifold-1.molior
7 cells
2 storeys
4 rooms
2 rooms
$ molior-ifc.pl non-manifold-1.molior
Here are the internal cells identified (the external cell isn't shown):

..and the network graph showing the connectivity between cells:

This is the IFC file, it has walls, slabs, windows, spaces, storeys etc... internal walls, doors between rooms etc... This is skinned with the default style in the molior module, so all the details are customisable by creating a new 'style':


Note internal walls, doors, non-quad shaped room:

Gotta go, this is just a proof-of-concept, but I'm convinced this is the way to go to get interactive design of buildings with full semantic BIM data.