How to create pillared graphene/nanotube structure?

Hi all,

I tried to manually create pillared structures of graphene like the attached image. However, it seems to be a hard task, and the result is not perfect. I wonder if scripting could be used to quickly and precisely generate several structures with different configurations. Could anyone help me with this issue?

Thanks a lot
Farzin