How to get all id_attachment with one loop?

How to get all id_attachment with one loop?