Exiled for murder
Involved in the murder of the Earl of Eglinton in 1585, Cunningham spent some time in exile at the royal court of Denmark, and the Danish government wrote to James VI of Scotland to reconcile him with Eglinton's heirs. His lands passed to Lord John Hamilton, but for a time Robert, Master of Eglinton was allowed to hold the House of Robertland with six men.
He was rehabilitated in 1589, when James VI himself travelled there to meet and marry Anne of Denmark. A Danish journal records that on 27 November 1589, the Danish ladies-in-waiting asked Jens Nilssøn, Bishop of Oslo to discuss the case with John Maitland, Chancellor of Scotland. The ladies, bishop and chancellor then had an audience with James VI at the Old Bishop's Palace in Oslo and he granted a pardon.
On arrival in Scotland he was appointed as 'sewer' or 'principal server' to Queen Anne, a courtier who attended to the royal person at mealtimes, and a role once occupied by James Hamilton of Finnart for James V.
On 14 March 1598 the Duke of Holstein, brother of Anne of Denmark, came to Edinburgh after travelling incognito through England, and announced himself to Robertland, who notified the queen who summoned James VI and the Duke of Lennox. The Duke was subsequently treated with great honour and expense, sent on a tour of Scotland, and banqueted in Edinburgh the house of John MacMorran, now called Riddle's Court.
Master of Work and Surveyor
He was appointed Master of Works to the king and queen on 13 July 1602 after the death of William Schaw. He followed the court of King James to England, having first been knighted in 1604, and then made Surveyor of the King's Works in England between 1604 and 1606. He resigned the Surveyorship to Simon Basil in April 1606.
As a new year's gift in January 1606, Cunningham presented the king with "a platt of an upright", a drawing of the elevation of a building.
David Cunningham the Surveyor is sometimes confused with a younger namesake cousin, David Cunningham of Auchenharvie, who corresponded with the surveyor's grandson Sir David Cunningham, 1st Baronet, of Robertland
- Aonghus MacKechnie, 'Sir David Cunningham of Robertland: Murderer and 'Magna Britannia's' First Architect', Architectural History, vol. 52 (2009), pp. 79–115
- Thomas Riis, Should Auld Acquaintance be Forgot, vol. 2 (Odense, 1988), p. 58.
- David Masson, Register of the Privy Seal of Scotland: 1585-1592, vol. 4 (Edinburgh, 1881), p. 387.
- David Stevenson, Scotland's Last Royal Wedding (Edinburgh, 1997), pp. 94-95.
- Papers relative to the marriage of James VI (Bannatyne Club, 1828), p. 28: Calendar State Papers Scotland: 1589-1603, vol. 10 (Edinburgh, 1936), p. 372.
- Calendar State Papers Scotland: 1589-1593, vol. 10 (Edinburgh, 1936), pp. 615, 621.
- Calendar State Papers Scotland: 1597-1603, vol. 13 (Edinburgh, 1969), p. 172.
- National Records of Scotland, Privy Seal Register, NRS PS1/73 f40v.
- McKean, Charles (2001). The Scottish Chateau. Sutton Publishing. ISBN 0-7509-2323-7. p.158.
- John Nichols, The Progresses, Processions, and Magnificent Festivities, of King James the First, vol. 1 (London, 1828), p. 596.
- Aonghus MacKechnie, 'Sir David Cunningham of Robertland: Murderer and 'Magna Britannia's' First Architect', Architectural History, vol. 52 (2009), pp. 79-115 at p. 91.
- Calendar of State Papers Scotland, vol. 13 part 1 (HMSO: Edinburgh, 1969), p. 541.
- John Summerson, in History of the King's Works, ed. HM Colvin, vol. 3 (London, 1975), pp. 105-6.
| Master of Work to the Crown of Scotland
Sir James Murray