Hundreds have been forced to evacuate after a 10-storey building partially collapsed – with one worker inside an excavator keeping the structure stable.