The python-script-tool tag has no wiki summary.
10
votes
2answers
4k views
How to make button that calls Python script as command rather than script tool?
I believe that in Arc9.3, commands could be created using VBA scripts. To add a custom command, you would navigate to Customize > Toolbars > Customize... and click UIControls. However, UIControls is ...
10
votes
2answers
669 views
How to implement MultiValue Parameter with Multiple Columns?
This might be a simple question, but I haven't been able to find a straightforward answer.
I'm working on an ArcGIS (9.3) Python script. One of the inputs is a list of features. For each feature, I ...
9
votes
1answer
2k views
How to create sidebar help information for Python script tools of ArcGIS Desktop?
I have been creating custom tools (Python script tools) using Python with the ArcPy module.
I can set up the tool successfully with parameters and all, but I cannot figure out how to create help ...
6
votes
2answers
811 views
Binding Objects to List for ArcGIS Python Script Tool Parameter?
I am working on a python based script/tool. I would like to make use of drop down lists for several of the parameters. This is very easy to do if the lists are just plain old strings.
Does anyone ...
5
votes
1answer
739 views
Setting up Drop-Down list in Parameters of Python script tool?
I am trying to create a tool from a python script I have written that will take a list I have created and use it as a drop-down menu in the finished tool as one of the inputs (see attached image for ...
4
votes
1answer
94 views
GP service (from Python script tool) time-out: how to execute finally: statement
I am trying to build more fail-management logic into some of the GP services I develop. As a part of the business logic within the script tool I build, I write some data into the tables and thus lock ...
3
votes
1answer
155 views
Using arcpy and script toolbox to add the date to a attribute table
I would like some information on how to add a date to an attribute table, by adding a user specified date in a script tool that will update the polygons attribute table. In short I have two polygons ...
3
votes
1answer
205 views
How to make multivalue input script run from a toolbox?
I have a working python script:
import arcpy
sdeconnection = arcpy.GetParameterAsText(0)
layerfiles = arcpy.GetParameterAsText(1).split(";")
for layerfile in layerfiles:
print layerfile
lyr ...
2
votes
1answer
148 views
Adding parameters to category in Python Script Tool?
There is plenty of documentation on how to add parameters to a category in a Python Toolbox i.e. see the bottom of ...
2
votes
1answer
75 views
ArcGIS Script Tool/Problems/Issues
I currently have a python script which will replace the data sources on a MXD with broken links. The code seems to work fine as I have run the code a handful of times using relative paths to indicate ...
2
votes
0answers
34 views
Error ET Geowizard Clean Polygon() takes no arguments (3 given)
I want to clean polygon feature classes with ET Geowizards (clean polygon) because I cannot find any tool within ArcMap (ArcInfo) that does the same. I have really small gaps within the polygons (but ...
2
votes
0answers
154 views
Get Unique Field Values Within Python Script Tool
Using ArcGIS 10.2.2 and Python. I have a script that currently counts the number of points (representing crimes) in each zip code area, and writes that value to a new column in the FC that contains ...
2
votes
0answers
59 views
Is there a way to position parameters in a Python script tool dialog box?
I admit I haven't searched for an answer yet.
I was wondering if there's a way to get these boolean parameters to be next to each other instead of one on top of the other?
1
vote
4answers
165 views
NameError: variable not defined even though set multiple times
This code original worked when run through the python command window in ArcCatalog. After I added the script to a toolbox I have had all sorts of troubles.
The most frustrating error has been:
...
1
vote
2answers
120 views
How to get Python script tool to take list of variables?
I am looking at making a Python script script tool that requires the user to input a series of attributes into a list, which is then used to build a query, to select multiple polygons (i.e. "abc, ...
1
vote
2answers
305 views
Alter validation in ArcGIS script tool
I have a script tool in ArcGIS 10.1. Some of the parameters are optional and if they are left blank, will not be processed. They are numerical parameters and I want to enforce this in the tool, so an ...
1
vote
2answers
75 views
Does arcpy.GetParameterAsText() have a data type?
import arcpy
# Retrieve input parameters
inX = arcpy.GetParameterAsText(0)
inY = arcpy.GetParameterAsText(1)
inDescription = arcpy.GetParameterAsText(2)
incidentsFC = "C:/Data/Yakima/Incidents.shp"
...
1
vote
1answer
94 views
How do I filter the layers that show for my input feature layer parameter for a custom tool?
When creating a custom tool using a Python script, is there a way to only show layers that, for example, contain a certain word?
For the drop down of the input polygon feature, I only want layers to ...
1
vote
1answer
51 views
How to get multiple value pairs as python script tool parameter
I've tried several different data types but can't figure out how to allow a user to create a list of elevation-temperature pairs. For example, a spreadsheet might look like this:
Is there a ...
1
vote
1answer
25 views
Creating ArcGIS tool that can run list of checks?
Is it possible to create a tool in Arcmap where by uploading a shapfile, the tool can run a various number of checks/tests (ie intersecting other shapefiles) and flags or highlights conflicting ...
1
vote
1answer
147 views
Python IDEs (PyScripter,PythonWin) crashing when installed with ArcGIS for Desktop?
I am learning Python, so here is a real newbie question!
Everything writen in ArcGis Python's windows is working fine. The same lines, correctly writen in an IDE, when run, are crashing it.
Working ...
1
vote
1answer
61 views
ERROR 000989 Issue with Python Script and Field Calculating distance between two long lat points
very new to scripting and I have been struggling with my script for a while. I'm not sure why it doesn't work in field calculator. I am trying to calculate a list of distance between two long lat ...
1
vote
2answers
35 views
Getting number as parameter to use in SQL expression leads to ExecuteError: ERROR 000358?
In my script I am using the Select tool (arcpy.Select_analysis) and in the SQL expression, I want to use a number that I call in as a parameter. I have trying to script it like:
subsize = ...
1
vote
1answer
48 views
Is there String Size Restriction in ArcGIS Python Script Tool parameter?
I'm trying to post a list of unique ID's (as a string) to a Python script tool for processing by ArcGIS Desktop 10.0.
The list may be 50k+ id's long (~450kb).
e.g. ...
1
vote
0answers
30 views
Modify a Python script to one that uses RasterDomain_3d fuctionality - and writes resulting shapefiles it to one
As I am not very experienced with Python I need your help. I managed to modify a Script (that has been posted here Get boundary of raster image as polygon in ArcGIS Desktop? by ...
1
vote
0answers
39 views
Options to use different Remap tables in a ModelBuilder or Python Script
I am trying to figure out if it is possible to embed multiple remap tables into a drop down type list or for an option to be selected to be used in a reclassify tool that outputs a final raster for ...
1
vote
0answers
42 views
Using choice of one parameter to populate column of multi-value control ready to have values for second column chosen?
This relates to my earlier question Can one parameter choice on Python toolbox tool set Display Names of other parameters?, but attempts to describe the requirement, rather than my attempted solution, ...
1
vote
1answer
41 views
Which parameter and Data Type to set for spatial reference in ArcGIS Python script tool?
I developed a python script for user defined grid and I want to make a tool from this script.
The problem I am facing is to set up parameter for spatial reference.
I used GetParameterAsText ...
1
vote
1answer
38 views
Options for publishing model with custom script containing call to .exe on GP server
So I have a ModelBuilder model that uses a custom python script, and within the script there is a call to a command line interface (CLI) executable. The model runs fine on my local desktop, but when I ...
0
votes
1answer
95 views
Syntax error using ArcPy Spatial Analyst module in Python [closed]
I'm very new to using python and figure I'm missing something obvious in the following script. I keep getting a "syntax error" message no matter how much I fiddle around with the first few lines. I ...