I have a button created using Python Add-Ins which pops up a dialog box which is built using wxpython. I am wondering if I can place a tool (Select Layer by Location) within that dialog box to get location coordinates of layer (basically select that layer). Once a layer is selected, it will fire back some values to the already open dialog box. Any word of advice on whether it is possible and how to create a class for tool would be very helpful here.

  • Not so much the 'select by location' tool that's already on the ArcMap toobar.. the relationship goes one way: custom buttons on ArcMap, not ArcMap buttons on custom form. You can make your own 'custom select by location' though... is that what you want to do? – Michael Stimson May 14 '14 at 0:29
  • I want a tool within a custom dialog box which gives same functionality as 'Select by Location' tool -- A custom 'select by location' is what I am looking for as long as I get layer location. – Ibe May 14 '14 at 0:32

No, you cannot. A GP Tool dialog is not an embeddable wx control.

  • Can I embed a tool within custom dialog then to get XY location by either using Python Add-Ins or wx? – Ibe May 14 '14 at 0:37
  • The best you can do is add an add-in tool to a toolbar that pops up your custom dialog in the onMouseDownMap event. Then your user would select a point and then fill out your form. – Jason Scheirer May 14 '14 at 0:39

I think the key here is the custom dialog box, if you're writing your own you could put all kinds of stuff on it. I've not done any python addins but have done a great many in C# that do all sorts of useful things.

The python form is a wxDialog http://www.wxpython.org/ which looks to operate in a similar manner to QT for QGIS.

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.