Firefighters were called to Mosside Drive in Blackburn on Thursday evening after a roof collapsed into a stairwell.
Residents were luckily unharmed but asked to stay in their homes while debris was cleared at the four-story block.
“This block of flats has been a cause for concern for some time now,” said West Lothian resident and member for Whitburn and Blackburn, Councillor Kirsteen Sullivan (Labour).
“The issue is further complicated by the fact that the flats are in private ownership.
“I will continue to work with council officers, community partners and local residents to find a solution to the problem.”
The Mosside Drive block of flats was used in a scene for last year’s Trainspotting sequel T2: Trainspotting.
Character Begbie, played by Robert Carlyle, can be seen walking into the flats.
Firefighters confirmed they were called at around 9.30pm on Thursday and were on scene for five hours.
A West Lothian Council spokesman said: “We were notified of a collapsed stairwell roof at a block of privately-owned flats in Blackburn’s Mosside Drive on Thursday.
“Council officers attended and assisted colleagues from the Scottish Fire and Rescue Service in making sure the area was safe for residents.
“Initial assessments suggest that lack of maintenance and damage caused by pigeons would be the likely cause of the collapse.
“Further checks are being carried out on the safety of the common access areas in the block of flats as a priority.
“The council would encourage the owners of the property to make good the damage already caused, and to carry out maintenance of the property to minimise the risk of further damage in the future.”
A build up of corrosive pigeon droppings in understood to have caused the roof of the block to cave in, smashing into the stairwell below.
Trapped residents living on the top floor were asked to remain in their homes while West Lothian Council and fire crews made the building safe.
The council spokesman confirmed no residents were evacuated and no temporary accommodation is required.
A spokesperson for the Scottish Fire and Rescue Service said: “The Scottish Fire and Rescue Service was alerted at 9.26pm on Thursday, July 26 to reports of a collapsed roof structure within the stairwell of a block of flats in Blackburn, West Lothian.
“Operations control mobilised a number of resources to the four-storey building on Mosside Drive.
“There were no casualties. “Residents were offered reassurance advice and requested to remain inside their properties while firefighters worked to make the area safe.”