Python add-in, GPToolDialog and Feature Set

1873
4
04-14-2014 11:54 PM
janssencanicula
New Contributor
Hi,

I have a script tool that has a feature set (interactive user input, e.g. draw a freehand polygon) as one of its parameters and works OK when run from ArcToolBox.

I plan to share this tool conveniently as a python add-in, so I tried invoking this GP tool using pythonaddins.GPToolDialog on an add-in button, but it seems that didn't work because, while the tool dialog appears on click, the dialog is modal in nature which prevents me from switching to the map frame to draw? Is this a limitation of pythonaddins.GPToolDialog?

Cheers,

JJ
Tags (2)
0 Kudos
4 Replies
EdFarrell
New Contributor III
Your right, my Python tool dialog will not let me have access to the map while it is open and launched from an add-in button tool. If the new polygon is used as input into your tool, you could program your tool to get the selected feature using a SearchCursor. If you provide more detail on your tool and workflow, I have some example code.
0 Kudos
janssencanicula
New Contributor
Hi Eddie,

Thanks for the reply, I am not really sure what you mean though with using the SearchCursor, unless you assume that the polygon is pre-existing as a feature class/shapefile that you browse to, which I could still do in a feature set parameter type(folder icon to the right). The polygon in my use case has to be created first and you can't do that when you can't access the map frame/ draw tool because of the dialog being modal. The polygon is not pre-known, so it has to be interactive. Thanks for confirming the limitation though.

Cheers,

JJ
0 Kudos
EdFarrell
New Contributor III
Have you found a solution yet? I just started a new thread about this to see if anyone else has.

http://forums.arcgis.com/threads/111064-Python-Add-In-GPToolDialog-modal-dialog-box
0 Kudos
JasonScheirer
Occasional Contributor III
Fixed in 10.2.2.