How to get a projection of a mesh?

How to get a projection of a mesh - e.g. 2D view of a building facade (so it could be exported as DXF), something like Freestyle does. Do you know some script or a way how to get only the edge/face parts, that are visible from camera?

Maybe this code can help you:

sorry for late reply, i had project deadline. Thx for the link, it is partially helpful. It realize visible vertices, in really short and clear script, thats nice.

Now I have yet to realize the edges, which have one vertex visible and the second not. And next to split the edge to get only the visible part.