0

Using Setting Script Tool Parameters Using Python and ArcGIS 9.3.1? I was able to properly set up the parameters of a script tool.

I would like to get the same dialog box from the script tool to appear when used from a button in ArcMap 9.3.1.

I know how to create a button and getting working, but only if it does not contain parameters. I'm assuming that this customization needs to be carried out using VB, or whatever other language.

Is there some generic code that can be used to create the same dialog box as the one that appears in the script tool?

I'm not a programmer (although I can hack may way through stuff in Python) so I don't know where to start.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Aug 31, 2012 at 21:13
1
  • You'll have to upgrade to 10.0 if you want to do this without programming. Commented Aug 31, 2012 at 23:59

1 Answer 1

2

This article shows how to do this in VBA (which you should be aware was removed at 10.1 and requires authorization at 10.0):

Private Sub UIButtonControl1_Click() 
'Ensure that there are references set to the 
'ESRI GeoprocessingUI Object Library and the
'ESRI Geoprocessing Object Library.
'Go to Tools > References to do this
Dim pUID As New UID 
pUID = "esriGeoprocessingUI.ArcToolboxExtension" 
Dim pATBExt As IArcToolboxExtension 
Set pATBExt = Application.FindExtensionByCLSID(pUID) 
Dim pAtb As IArcToolbox 
Set pAtb = pATBExt.ArcToolbox 
Dim pTool As IGPTool 
'* Use this line for custom tools or models
'* ========================================
Set pTool = pAtb.GetToolbyNameString("MyModel") 
'* Use this line for existing tools
'* ================================
'Set pTool = pAtb.GetToolbyNameString("buffer_analysis") 
Dim pCommand As IGPToolCommandHelper 
Set pCommand = New GPToolCommandHelper 
pCommand.SetTool pTool 
pCommand.Invoke Nothing 
End Sub
answered Sep 1, 2012 at 0:08
0

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.