Get pipes with certain direction

This thread could interest you too: