David Cunningham of Robertland

Sir David Cunningham of Robertland, in Ayrshire, was Master of Works to the Crown of Scotland from 1602 to 1607, and Surveyor of the King's Works in England from 1604 to 1606

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. James' mother-in-law Sophie of Mecklenburg-Güstrow wrote to him on 30 December, thanking him for pardoning Robertland.

Scottish courtier
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.

In January 1592 Robertland was imprisoned on suspicion of helping the Earl of Bothwell who had made a raid on Holyrood Palace.

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 with William Schaw, 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.

Significant buildings and monuments in Scotland in his time of office include; the Kennedy Aisle at Ballantrae for Jean Stewart, Lady Bargany.

Marriage and family
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

David Cunningham married Jean Cunningham, a daughter of Alexander Cunningham of Aiket. Their children included:
 * David Cunningham of Robertland (d. 1619)
 * Christiern Cunningham
 * Frederick Cunningham
 * John Cunningham

One son was a gentleman of the chamber to Count Maurice in the Netherlands. He was arrested in Hull while bringing muskets for James VI in August 1599.