Forum

Author Topic: Get ruler coordinates  (Read 2163 times)

Natsumi

  • Newbie
  • *
  • Posts: 12
    • View Profile
Get ruler coordinates
« on: August 26, 2021, 04:57:16 AM »
Hi everyone,

I want to get the coordinates using ruler but I can't.
I want to know the X and Y coordinates displayed on the console.
teach me please.

Thank you in advance

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14843
    • View Profile
Re: Get ruler coordinates
« Reply #1 on: August 26, 2021, 05:07:00 PM »
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:
Code: [Select]
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()]
Best regards,
Alexey Pasumansky,
Agisoft LLC

Natsumi

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Get ruler coordinates
« Reply #2 on: August 27, 2021, 05:06:47 AM »
It went well.
Thank you.

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Get ruler coordinates
« Reply #3 on: September 06, 2021, 11:46:47 AM »
Good to know. Thanks Alexey.