Hmm, perhaps it can be done... i'm not so skilled in ruby, but here are some really good guys. I'm tkinking if any drawing operation could be recorded as ruby action. If you draw a line, some observers to stay and watch every move and record in a text file the first point, second point and the line adding between that points. In theory there is no limit of observers that you can use but I'm not aware about how much will slow down the computer. Of course, the file can go really big. Or can be recorded just created faces/components/groups. This can make the job a little smaller. At least for simple geometry this could work.
Just a stupid ideea... π