Not designed to replace the 45. The New York Yacht Club wanted a new racer/cruiser, and the Swan won. There were other proposals from Farr, and Mark Mills. Originally, Swan proposed the 45, but it was too expensive, so they came up with the 42 - with the hull being moulded in Estonia, I think, to make it a bit cheaper. Still nearly twice the price of the new X-41 one design, though.
It's generally believed that one of the reasons the Swan won is that it benefits from the Swan 'cachet'.
Rumour has it that a number of Swan45 owners - particularly in the US - are less than impressed - while the 42 isn't cheap, it's a lot less than the 45.