I don't know of an exporter that will do what you want, though there are lots of different renderers out there that might give an option like this.
This might help. On exporting, you can choose to export by layer. So you could then have all the geometry separated by layers inside 3dsmax already. Then you could manipulate them there if you'd like.
Otherwise, looks like you might be writing your own ruby.
Chris