I'm building a python addin tool in arcgis and I would like to click a feature, say a polygon on the map, and get the polygon's attributes,i.e. ID=3,NAME = "CITY3"...It's similar as the arcmap tool Identify without a pop-up window.

I can only think of a way by getting the mouse click XY first, and do a select by location query to get the feature.I'm wondering is there a better way of doing this?

Or is it possible to grab the information from Identify tool using python addins?


No, that's the way to do it. Respond to a mouse click event and then select by location, get the values using arcpy.da.searchcursor.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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