Making a special polymer

I want make my polymer stretched along Z direction with the change in length of simulation box along Z direction only. I tried setforce command but that does not work. Can you please help me out?

Sorry, but this is too vague a description to give specific advice. Can you elaborate some more about your system and perhaps provide a screenshot or similar to demonstrate your system setup.