This script, from Blender Artists worked when I ran it but it has its limitations.
import bpy
from mathutils import *
with open("C:/Users/...YOUR PATH/Desktop/measureit_output.txt", mode="w") as f:
objects = bpy.data.objects.items()
for obj in objects:
mg = obj[1].get('MeasureGenerator')
if mg:
obj_name = obj[0]
for e in mg[0].items():
if e[0] == 'measureit_segments':
ms = e[1]
for m in ms:
measure_name = m.get('gltxt')
measure_points = (m.get('glpointa'), m.get('glpointb'))
vdata = obj[1].data.vertices
a = vdata[measure_points[0]].co
b = vdata[measure_points[1]].co
length = (a - b).length
print(f"{obj_name};{measure_name};{length:.2f}")
f.write(f"{obj_name};{measure_name};{length:.2f}\n")
print()
Limitations
As I said it has limitations which I can't adequately bug test.
It seems to work fine for measurements inside objects, but does not output the distances between between objects or the objects and the origin correctly when I use 'Link' or 'Origin'.
The output.txt file looked like this, notice the last figure is incorrect and does not match with my image:
Cube;Ymeasure;2.00
Cube;Zmeasure;2.00
Cube;Xmeasure;2.00
Suzanne;Xmeasure;1.64
Suzanne;Suzanne-Cube;1.39
A workaround might be creating an object for your measurement such as a simple mesh line.