viewing

I tried to view the data file generated by writing the “write_data” command at the end of the simulation. I opened it through the VMD tk console by writing.

topo readlammpsdata full

It works fine.

But when I open the data file I can see the atoms are occupying varying Z-levels. But VMD is showing only 2 Z-levels. Why this is happening? please help.

I tried to view the data file generated by writing the "write_data" command
at the end of the simulation. I opened it through the VMD tk console by
writing.

topo readlammpsdata <filename> full

It works fine.
But when I open the data file I can see the atoms are occupying varying
Z-levels. But VMD is showing only 2 Z-levels. Why this is happening? please
help.

most likely your topo command is wrong. what is your atom style?