Forum

Author Topic: Script to import scale bar between markers?  (Read 3389 times)

guiclin@msn.com

  • Newbie
  • *
  • Posts: 5
    • View Profile
Script to import scale bar between markers?
« on: July 05, 2019, 05:47:19 AM »
Hi,
I have a text file with a list of scale bars (*105) between markers.
Please, would you have a script to create them and import the value?
Cheers

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Script to import scale bar between markers?
« Reply #1 on: July 05, 2019, 11:15:07 AM »
Hello guiclin,

Do the labels of the scale bars in the text file correspond to the scale bars in the project? Or whether the script should also create the scale bar instances between the corresponding markers?
Best regards,
Alexey Pasumansky,
Agisoft LLC

guiclin@msn.com

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Script to import scale bar between markers?
« Reply #2 on: July 08, 2019, 02:15:12 AM »
I would prefer if it could create the scale bar too because I have a lot of them...


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Script to import scale bar between markers?
« Reply #3 on: July 18, 2019, 08:37:11 PM »
Hello guiclin,

Please check, if the attached script works for your needs.

If not, please send the example project file (in PSZ format) and related CSV file for testing to support@agisoft.com.
Best regards,
Alexey Pasumansky,
Agisoft LLC

OakCorp

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • OakCorp
Re: Script to import scale bar between markers?
« Reply #4 on: January 06, 2020, 12:09:52 PM »
How do you use this script? Metashape 1.6 gives the following error:

Code: [Select]
IndentationError: unindent does not match any outer indentation level
2020-01-06 18:07:22 Error: unindent does not match any outer indentation level (D:/PS150_import_scale_bars_from_csv.py, line 59)
--------------
OakCorp,
yuji yamauchi [senior tec support]

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Script to import scale bar between markers?
« Reply #5 on: January 06, 2020, 03:34:09 PM »
Hello OakCorp,

There seem to be an excessive space symbol in the line 59 right before the "except"  key word. If you remove it, the script should work.
Best regards,
Alexey Pasumansky,
Agisoft LLC

OakCorp

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • OakCorp
Re: Script to import scale bar between markers?
« Reply #6 on: January 07, 2020, 06:42:29 AM »
Hello,  Alexey

Thank you for the advice.
Worked well

Best wishes,
-------
Yuji Yamauchi
OakCorp Support
--------------
OakCorp,
yuji yamauchi [senior tec support]

OakCorp

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • OakCorp
Re: Script to import scale bar between markers?
« Reply #7 on: January 07, 2020, 09:43:21 AM »
Is there a description of the rules for the .csv format imported by this script?
Another thread?

Best wishes,
-------
Yuji Yamauchi
OakCorp Support
--------------
OakCorp,
yuji yamauchi [senior tec support]

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Script to import scale bar between markers?
« Reply #8 on: January 08, 2020, 03:23:04 PM »
Hello Yuji,

The CSV file for the script should contain the scale bar label and distance in each line (with "tab" delimiter).

The label should contain labels of the corresponding marker separated with "_" symbol.

But if necessary, you can use any custom CSV format, you just need to adjust the lines related to the file scanning.
Best regards,
Alexey Pasumansky,
Agisoft LLC

OakCorp

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • OakCorp
Re: Script to import scale bar between markers?
« Reply #9 on: January 09, 2020, 10:34:10 AM »
Hello,  Alexey

Thank you for the details.
Very helpful.

Best wishes,
-------
Yuji Yamauchi
OakCorp Support
--------------
OakCorp,
yuji yamauchi [senior tec support]