〜ところに・〜ところへ・〜ところを
just when; (caught) in the middle of
Verb plain form (often ている / た) + ところに / ところへ / ところを
Sign up free to review this point on a spaced schedule.
ところに and ところへ mean "just at that moment", when someone or something arrives and interrupts: 出かけようとしているところに、電話がかかってきた, "just as I was about to go out, the phone rang". The second half is usually 来る, かかってくる or another arrival.
ところを is used when someone is seen, caught or helped in the middle of something: たばこを吸っているところを、先生に見られた, "my teacher caught me smoking". The second half is often a passive verb (見られる, 起こされる) or 助ける.
The set phrase お忙しいところを, "when you're so busy", thanks someone for their time.
These are all built on ところ, "the point in time", from N4.
Examples
出かけようとしているところに、電話がかかってきた。
Just as I was about to go out, the phone rang.
困っているところへ、友達が助けに来てくれた。
Just when I was in trouble, a friend came to help.
たばこを吸っているところを、先生に見られた。
My teacher caught me smoking.
お忙しいところを、ありがとうございます。
Thank you for taking the time when you're so busy.
寝ているところを起こされた。
I was woken up while I was asleep.