to export 2d graphics by layer you can exchange line 72
model.export(modelpath+"/"+modeltitle+"_Layer"+layername+"."+type,false)### exporter
by:
view = model.active_view
view.write_image (modelpath+"/"+modeltitle+"_Layer"+layername+"."+type)
this will dissable all 3D-Export possibilities and you have to use valid Image file formats liek 'jpg' as type.