VMD has a nanotube builder that I can use to build CNT and then using topotools I am able to produce the data file for LAMMPS. For my specific research I need to create a fake CNT with triangular lattice instead of hegxagonal. I can create that with mathematica but it explodes and I guess it is because I do not have the dihedral and other angle informations.
My question is if you know of any (preferably free) software that I can use to create my own specific lattice shape nanotube and get the data file as an output?
First, can you clarify what you mean by "it explodes"? Have you ensured that there are no overlaps in your simulation and that the force-field parameters are correct?
Moltemplate is another free, open source powerful program for preparing LAMMPS datafiles. There is an extensive set of tutorials including one on nanotubes. Moltemplate uses .LT files that are basically the pieces that construct the system. Then using system.lt file and with different options, you can create a LAMMPS datafile along with other optional input files. My suggestion: Try to read the actually very well-written manual. Start with a few simple examples found in examples folder and then try to find similar examples to your system.