Similar to what is talked about here?
I know that in AutoCAD MEP one can create an AEC polygon from a polyline.
You can do it using Visual C++ like here: http://www.ucancode.net/faq/PolyPolygon-Polygon.htm
What program were you doing this in originally? I've seen it done in Map 3D but not in plain AutoCAD.