1
Python and Java API / Re: Scale a model / Accuracy / multiple sizes
« on: August 30, 2019, 03:51:24 PM »
Dear Alexey,
as always - you are right - I can do that manually and the calculated length is correct. But for me the problem still exists:
I can not use the GUI - I have to use python console.
This is part of the script I am using:
----------------------------------------------
import PhotoScan
chunk = PhotoScan.app.document.chunks[0]
for m in chunk.markers:
try:
print (str(m.label))
m.reference.enabled = 0
except Exception as e:
print(e)
for sbs in chunk.scalebars:
print (str(sbs))
sbs.reference.distance = 300
sbs.reference.accuracy = 0.00001
chunk.updateTransform()
----------------------------------------------
And get an Output:
2019-08-30 14:44:48 target 1
2019-08-30 14:44:48 'PhotoScan.Marker.Reference' object attribute 'enabled' is read-only
2019-08-30 14:44:48 target 2
2019-08-30 14:44:48 'PhotoScan.Marker.Reference' object attribute 'enabled' is read-only
2019-08-30 14:44:48 target 3
2019-08-30 14:44:48 'PhotoScan.Marker.Reference' object attribute 'enabled' is read-only
2019-08-30 14:44:48 target 4
2019-08-30 14:44:48 'PhotoScan.Marker.Reference' object attribute 'enabled' is read-only
2019-08-30 14:44:48 <Scalebar 'target 2_target 3'>
2019-08-30 14:44:48 <Scalebar 'target 1_target 2'>
(I use Photoscan 1.4.3 - 6529 & Win10)
as always - you are right - I can do that manually and the calculated length is correct. But for me the problem still exists:
I can not use the GUI - I have to use python console.
This is part of the script I am using:
----------------------------------------------
import PhotoScan
chunk = PhotoScan.app.document.chunks[0]
for m in chunk.markers:
try:
print (str(m.label))
m.reference.enabled = 0
except Exception as e:
print(e)
for sbs in chunk.scalebars:
print (str(sbs))
sbs.reference.distance = 300
sbs.reference.accuracy = 0.00001
chunk.updateTransform()
----------------------------------------------
And get an Output:
2019-08-30 14:44:48 target 1
2019-08-30 14:44:48 'PhotoScan.Marker.Reference' object attribute 'enabled' is read-only
2019-08-30 14:44:48 target 2
2019-08-30 14:44:48 'PhotoScan.Marker.Reference' object attribute 'enabled' is read-only
2019-08-30 14:44:48 target 3
2019-08-30 14:44:48 'PhotoScan.Marker.Reference' object attribute 'enabled' is read-only
2019-08-30 14:44:48 target 4
2019-08-30 14:44:48 'PhotoScan.Marker.Reference' object attribute 'enabled' is read-only
2019-08-30 14:44:48 <Scalebar 'target 2_target 3'>
2019-08-30 14:44:48 <Scalebar 'target 1_target 2'>
(I use Photoscan 1.4.3 - 6529 & Win10)