1

Im trying to get the layer coordinates with a mouse click in ArcMAP. I did this in QGIS and im not finding anything on how to get this working in ArcMAP. Here is the QGIS version:

def selectPoint(self):
 self.pointEmitter = QgsMapToolEmitPoint(self.iface.mapCanvas())
 QObject.connect(self.pointEmitter, SIGNAL("canvasClicked(const QgsPoint, Qt::MouseButton)"), self.selectNow)
 self.iface.mapCanvas().setMapTool(self.pointEmitter)

I got this working by creating a new plugin in plugin wizard and Choosing a "Tool" in the Toolbar.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Nov 26, 2017 at 23:28
1

1 Answer 1

2

If you are trying to do this from ArcPy then you could look at using:

Feature sets allow features to be entered interactively and immediately used as input to a model or script.

Python Add-ins give users the ability to create Python written tools that respond to a mouse click.

answered Nov 27, 2017 at 2:01
2
  • i cant find "onMouseDownMap" on the add.in wizard. Is there a way to call that function in a existing add-in? Commented Nov 27, 2017 at 9:18
  • @JoséGabriel the AddIn Wizard writes code that includes it. Commented Nov 27, 2017 at 10:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.