1
Python and Java API / How export the Date & time
« on: July 18, 2019, 12:47:43 PM »
Hello !
I would like add the date and the time to my txt export file.
Below, the script, that i use to export my markers.
I want add Date&time after the Name of markers. Some help please for the script ?
Regards !
Alex
I would like add the date and the time to my txt export file.
Below, the script, that i use to export my markers.
I want add Date&time after the Name of markers. Some help please for the script ?
Code: [Select]
import Metashape, math
FILEPATH1 = 'C:/Alexandre/PFE/7.Couloir/Les_scène_refait/PYTHON/Export_donnée/Coordo_marker.txt'#lien fichier export
#Export des Markers
doc = Metashape.app.document
chunk = doc.chunk
T = chunk.transform.matrix
f = open(FILEPATH1, 'w')
for item in chunk.markers:
if item.position == None:
continue
v = item.position
v.size = 4
v.w = 1
if not chunk.transform:
chunk.transform.matrix = Metashape.Matrix.Diag( (1,1,1,1) )
T = chunk.transform.matrix
v_t = T * v
v_t.size = 3
proj = chunk.crs
v_out = proj.project(v_t)
f.write(item.label + ',' + str(v_out[0]) + ',' + str(v_out[1]) + ',' + str(v_out[2]) + '\n')
f.close()
Regards !
Alex