2

Is there any possibility to add a Point-Feature as an input parameter in a ArcPy-/ArcGIS-Python-script? If I choose "Point" as datatype in the parameter list, I get 2 input-fields for a X- and a Y-coordinate. What I want is something like a button to get a crossfade cursor for selecting "on-click" a coordinate in the map. Is there anything like this?

1
  • 2
    I would look into using a Feature Set.
    – PolyGeo
    Nov 18, 2014 at 10:53

1 Answer 1

1

If you want your tool to interact with the map, you need to write a python add-in. To retrieve the X and Y coords of the point you click, use the x and y values of the onMouseUpMap() or onMouseDownMap() function of the Tool add-in class.

You have a nice example of code that corresponds to this in this article: HowTo: Capture map coordinates with a mouse click using Python.

And the help section about Python add-ins is here.

1
  • 1
    A Python AddIn is a good option but a regular tool authored using either ModelBuilder or Python using a Feature Set parameter can also be used.
    – PolyGeo
    Nov 18, 2014 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.