Forum

Author Topic: ‘ marker.reference.enabled’ is read-only  (Read 1718 times)

xinglei

  • Newbie
  • *
  • Posts: 9
    • View Profile
‘ marker.reference.enabled’ is read-only
« on: October 20, 2020, 03:07:28 PM »
My script:

for marker in chunk.markers:
    if marker.label == 'GCP0':
        marker.reference.enabled = False
        break

AttributeError: 'Metashape.Marker.Reference' object attribute 'enabled' is read-only

How can I implement Uncheck(no tick in the check box next to each marker) or Check for Markers using Python?

Thank you!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14890
    • View Profile
Re: ‘ marker.reference.enabled’ is read-only
« Reply #1 on: October 20, 2020, 07:47:23 PM »
Hello xinglei.

I think the Python Console in your current Metashape instance is broken by incorrect use of some other code that is not posted here, for example, if you have used marker.Refernece.enabled = False assignment or similar with incorrect use of the caps letters. I suggest to re-start Metashape and use proper assignment, as posted in your script.
Best regards,
Alexey Pasumansky,
Agisoft LLC

xinglei

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: ‘ marker.reference.enabled’ is read-only
« Reply #2 on: October 21, 2020, 03:31:03 AM »
Hello Alexey

I  re-start Metashape and there is no error

Thank you!