The class of year 6 pupils, including Sam Lawson (11), were joined on the trip by Sam's father, Rob (44), and grandfather, Jim Lawson (68).
Larnach Castle marketing manager Deborah Price said when the castle learned Sam would be part of the visiting class, they invited Rob and Jim too.
''This is the first time three generations are here together.''
Sam had done a school project on his great-great-great-grandfather before the trip and said he liked learning about architecture.
The Lawson family felt a special connection to their architect ancestor, whose involvement in Dunedin extended further than Larnach Castle.
Robert Arthur Lawson designed several of Dunedin's landmark buildings, including First Church and Otago Boys' High School, where Rob went to school, as well as commercial buildings in both Otago and Melbourne in the late 1800s.
Since Robert Arthur Lawson, no member of the family had followed in his architectural footsteps, but Rob and Jim said Sam was displaying some artistic flair, was good at making things and at drawing.
''Sam has been the first sign, he's keen with a pen,'' Jim said.
While architecture had not continued down the family tree, the Lawson family had passed down other traditions, such as the family name - the first names Robert Arthur and James Newburgh had alternated every generation.
Sam's full name is James Newburgh Sam Lawson.
Farming as a career had also become a family tradition.
Jim's father Robert, the original Robert Arthur Lawson's grandson, started farming at Moana at Waikouaiti in 1950 and the farm has been home to three generations of Lawsons.