It depends on what you want in the corners. If you don't need something too polished you can also use this plugin:
Link Preview Image [Plugin] Lines to tubesHi all, Here is an update of my former script "line2cyl.rb". Intended to create renderable wire frame models. Some bug fixes and enhancements: Make group of...
faviconsketchucation (community.sketchucation.com)
It will work in one go: select all the lines and launch the plugin.