Forum

Author Topic: Adding a new marker with coordinates  (Read 6904 times)

r0xx

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Adding a new marker with coordinates
« on: January 05, 2015, 07:27:27 PM »
How can I add a new marker to my chunk with predefined coordinates?
chunk.addMarker() does not do what I want... How can I do that?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15177
    • View Profile
Re: Adding a new marker with coordinates
« Reply #1 on: January 05, 2015, 08:27:08 PM »
Hello r0xx,

using marker = chunk.addMarker() will create a marker instance.
Then you should add reference coordinates as following: marker.reference.location = PhotoScan.Vector([x, y, z])

Best regards,
Alexey Pasumansky,
Agisoft LLC

r0xx

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Adding a new marker with coordinates
« Reply #2 on: January 06, 2015, 10:48:00 AM »
Ok thanks alot! THis works great!
« Last Edit: January 06, 2015, 10:49:56 AM by r0xx »

velutis

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Adding a new marker with coordinates
« Reply #3 on: April 26, 2017, 02:23:46 PM »
Hi, i am getting error using this code:

Code: [Select]
chunk = PhotoScan.app.document.chunk
m = chunk.addMarker()
m.reference.location = PhotoScan.Vector((0,0,0))

AttributeError: 'PhotoScan.Marker.Reference' object attribute 'location' is read-only

Anyone knows why?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15177
    • View Profile
Re: Adding a new marker with coordinates
« Reply #4 on: April 27, 2017, 09:15:36 AM »
Hello velutis,

Which version of PhotoScan you are using? I've tried your code on 1.3.1 and it worked.
Best regards,
Alexey Pasumansky,
Agisoft LLC

velutis

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Adding a new marker with coordinates
« Reply #5 on: April 27, 2017, 10:09:20 AM »
so strange, now it wokrs after pc restart, sorry