automated roof

On 03/11/2016 at 13:48, xxxxxxxx wrote:

Here's what i want to achieve: I have a bunch of objects,like cubes,parallelepipeds and other extruded shapes in fact they are meant to be houses,but in this state(now) they are without roof
I was wondering if anyone knows to make a script to add roof instantly to those shapes,it doesn't need to be necessarily complex or finished,if it's possible the better,but i'm happy with  very simple roof also :),like these

The process of modelling it requires just a few steps,as anyone knows,at least for the simplest one(from the left),
1.selecting the top polygon of the object
2.extruding it.
3.selecting the 2 top points from one of the polygons with smaller x value(at least on this model)
4.apply Weld command
then other 2 steps ,the same for the other opposite polygon.
Or if you can take it further and thinking about adding windows,doors or other elements,that would be really something.