Ben Wright hit his first century of the season as Glamorgan built a sizeable lead over Middlesex at Lord's.
Wright made 101 after Gareth Rees (75) and William Bragg (87) had taken their second-wicket partnership to 140.
Glamorgan closed day two with a lead of 367 on 517-8 as Mark Wallace (46), James Harris (41) and Graham Wagg (63) also contriubuted.
Tim Murtagh took 3-97 for the hosts, while there were two wickets each for Toby Roland-Jones and Neil Dexter.
CLOSE OF PLAY SUMMARY
BBC Radio London 94.9's Kevin Hand:
"Another dreadful day for Middlesex as Glamorgan batted patiently at first before making their hosts pay for their poor first-day performance. The bowling showed signs of improvement today but was again short of the expected level.
"Ben Wright's century was the stand-out display for the visitors as he batted confidently, cashing in on the hard work of Gareth Rees and William Bragg earlier in the day.
"Glamorgan have won all six sessions of the match so far and, at the halfway stage, Middlesex must find some steel, as it appears as though they'll need to bat until at least tea on the final day to save the game."
BBC Wales cricket correspondent Edward Bevan:
"A century from Ben Wright, three other batsmen scoring over 50, and five different partnerships over 50 reflects how well Glamorgan's batsmen performed.
"They gained five maximum batting points and now lead Middlesex by the massive margin of 367 runs.
"With two days remaining, Glamorgan have an excellent chance of victory but they can expect Middlesex's powerful batting line-up to improve on their first-innings performance."