Hello Natsumi,
You can parse the console output.
For example, the following line gets X and Y values for the first measured point by a ruler tool:
x, y = [float(i) for i in Metashape.app.console_pane.contents.rsplit("Ruler coordinates:\n", 1)[1].split("\n", 2)[1].split(" ", 2)[-1].replace("X", " ").replace("Y", " ").strip().split()]