Blender FGON to AC3D NGON

I have been trying to solve a ‘Blender FGON to AC3D NGON’ exporting problem. Well, this problem is though nut for my beginner python skills.

Anyhow, in general level I have been thinking something like this

Flow chart
-A mesh object:
-Check the edges for the FGON’s: no?
-Check which surfaces are related to the above FGON edges.
-Check which edges are related to the above surfaces?
-The ‘refs’ value = number of the ‘normal edges’ - number of the ‘FGON edges’
-Surf = surf 1
-Read edges excluding the FGON edges
-Re-arrange the edge order
-Export the new FGON2NGON ‘refs’ data

Am I in right path with this?

Any comments?

I can detect the NGON edges(EdgeFlags.FGON) and polylines (EdgeFlags.LOOSE) but I’m not sure how proceed from here.