QGIS export coords on mouse click in file

15 views Asked by At

I am trying to export the coordinates a user left-clicks in QGIS to a simple txt file automatically (I need to get this info to my labview VI) but have been unsucessfull yet, any ideas?

Copilot proposed

canvas = iface.mapCanvas() def display_point(point, button): coords = "{}, {}".format(point.x(), point.y()) with open('coordinates.txt', 'a') as f: f.write(coords + '\n') `canvas.xyCoordinates.connect(display_point)``

but no idea what "button" should be, I do not know python

0

There are 0 answers