Hello latexx,
the error indicates that no geographic coordinate system is defined for the chunk.
You can try the following script where the additional check is implemented:
import PhotoScan
FILEPATH = 'C:/marker_export.txt'
app = PhotoScan.app
doc = PhotoScan.app.document
chunk = doc.chunk
f = open(FILEPATH, 'w')
for marker in chunk.markers:
if marker.position == None:
continue
T = chunk.transform.matrix
v_t = T.mulp(marker.position)
if chunk.crs:
v_out = chunk.crs.project(v_t)
else:
v_out = v_t
f.write(item.label + ',' + str(v_out[0]) + ',' + str(v_out[1]) + ',' + str(v_out[2]) + '\n')
f.close()