1

I have scripted an ArcPy tool and the tool works fine in ArcGIS 10.2. The only problem is when I use the tool I can't drag and drop current map elements into the parameters, I have to manually navigate to the file through explorer each time, also there isn't a drop down menu of current map items to select from either?

Is it something to do with how I have set the tool parameters or is it a scripting issue?

  • 1
    What data type have you set the parameters to? – Michael Stimson Aug 12 '14 at 0:28
  • 1
    Would you be able to edit your question to include pictures of one tool parameter that you would have expected to be able to drag and drop into and its current parameter settings, please? – PolyGeo Aug 12 '14 at 0:29
  • 2
    I think the parameter needs to be "Feature Layer" instead of "Feature Class" if you want to use items from the MXD's Table of Contents. – Erica Aug 12 '14 at 0:31
  • 1
    @Erica yeah I think you're right. I'll update the screenshot below – Stephen Lead Aug 12 '14 at 0:38
4

Open the Properties of the script tool, and head to the Parameter tab:

enter image description here

Enter the parameters on the left-hand side, and choose the parameter type on the right-hand side dropdown.

Please let me know if you're still not seeing the expected behaviour after making these changes.

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.