I think unless you have a machine with a very long free arm(can't think of one) so the pant leg won't bunch up under the machines arm or a post machine(industrial) you're not going to accomplish this task the way you're imagining it to be done unless you sew it by hand.
Cari