3

I found a python script (Drawing parallel lines inside polygons (Well Paths)?) I would like to use in an analysis. However, I don't understand how to add the script posted by @phloem to ArcMap.

Following an an older tutorial, for ArcMap 9.2 (http://webhelp.esri.com/arcgisdesktop/9.2/tutorials/GP_3_3.htm) assisted me in the creation of a script within a toolbox. But, after running the new script, the dialogue box says "no parameters".

How do I setup the new script, along with the relevant parameters necessary to execute the script as a tool? I am using ArcMap 10.3.1

  • so you are looking to set up the parameters of your script, not add a script to arcmap yes? please clarify – Maksim Sep 27 '16 at 19:16
  • I have never worked with scripts before. So, please excuse my limited understanding of the vocab involved. I did manage to edited the question to reflect setting up a new script and parameters. Hope it helps. – SlyWhiteSheep Sep 27 '16 at 20:13
  • @slyWhiteSheep Can you share the screen shots of the parameters tab after you set this script up? – Robert Hendrickson Mar 28 at 18:26
8

Sounds like you already successfully added your script to the toolbox, so you're close. You just need to set the parameters that are listed in the script within ArcMap if you want to run the script as a tool. In your catalog, right click on your script tool that you created and click on properties. You need to define your parameters under the parameters tab.

So, you would set your first parameter up like this:

Display Name - polyFC (or whatever you want it to be displayed as in the tool) Data Type - String

Under parameter properties, you would set the following: Type - Feature layer Direction - Input

You can then add the rest of your parameters, though the parameter properties and types may be different depending upon how they are used in the script.

The only other thing to note is that parameters defined in ArcMap need to be in the same order as the ones defined in your script.

Here's a good page on setting parameters: http://desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/setting-script-tool-parameters.htm

And here's the page that lists all the different types of parameters (sometimes all the different types can get confusing, so it's nice to have a list!): http://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/defining-parameter-data-types-in-a-python-toolbox.htm

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.