@Peter2
Look, I've changed slightly (unit) sub function - first from beggining, not to throw "divide by zero" error, but I doubt that error is solved - it should passed and wihtout my intervention... Simply something is not good in the drawing... Like I said first 3 points define plane at which 3dpoly should be projected to lwpoly, and for lwpoly to 3dpoly, there should be no arced segments and it should perform conversion from any plane as lwpoly is planar entity... Are you sure your UCS is WCS before starting routine, if not, set it that way, but I think that that's not the problem...