Please see the Enhanced Monte Carlo package - it has all the tools to build any structures you like ( starting from crystals and nanotubes ending with polymers and etc. ) they have a built in script for the nanotube, so you can follow the procedure and build a script for yourself. (the examples and tutorials are in the examples/ and doc/ folders and you can get them after the download)