Python toolboxes are geoprocessing toolboxes that are created entirely using Python in ArcGIS 10.1 (and later) for Desktop

learn more… | top users | synonyms

11
votes
2answers
689 views

Why learn/use Python Toolboxes over Python Script Tools?

I've written a few Python Toolboxes (which are new at ArcGIS 10.1), but am yet to decide whether/when I should write them rather than Python Script Tools in a standard toolbox. I thought the Online ...
8
votes
2answers
362 views

Is there a way to refresh imported modules in a ArcGIS Python Toolbox?

When using a python toolbox (.pyt) in ArcMap, I'll typically follow a pattern where the .pyt file itself is simply a wrapper to collect input arguments and define the tools themselves. Supporting ...
7
votes
2answers
149 views

How to Determine if Layer is a Point

I have been working on a Python toolbox which contains 6 parameters. I am a little lost on all of the different data types available in ArcMap (it seems like there's hundreds of them!). However, one ...
6
votes
1answer
447 views

Are there any distinct advantages of creating a Python Toolbox over a Custom Toolbox?

I enjoy making different geoprocessing tools to practice Python and to become more familiar with the arcpy modules. I've just been using a Custom Toolbox and then importing the Python script and ...
6
votes
1answer
51 views

Ordering tool display within a Python Toolbox

I have created a python toolbox containing a number of classes which define the various tools within. As these classes are part of a workflow in which the tools are to be executed sequentially using ...
5
votes
3answers
971 views

define parameter descriptions in ESRI Python Toolbox

I'm trying to create some Python Toolboxes for our ArcMap application (e.g. MyTool.pyt) I can see that the help text is defined with the classes self.description attribute. However, once I run the ...
5
votes
2answers
178 views

Can ArcGIS Pro use Python toolboxes written for ArcMap?

Can the new ArcGIS Pro use existing ArcToolbox scripts? Or to put it another way, will I have to rewrite my existing ArcMap toolbox & python scripts if I want them to run in ArcGIS Pro?
5
votes
2answers
737 views

Using Custom Functions in a Python Toolbox

I am trying to put together a python toolbox (Arc 10.1) and would like to use a defined function in my code. The function is: 'sys' is imported at the top of the file def listdirs(folder): ...
5
votes
1answer
95 views

Set default values for value table in Python Toolbox tool

I created a Python Toolbox tool to reorder fields and create a new feature class with the reordered fields. The tool works nicely and I am able to use a value table to let the user arrange the fields ...
4
votes
1answer
104 views

Where can I find in depth documentation on modifying arcgis stylesheets?

Where can I find in depth documentation on modifying arcgis stylesheets? I have found some of the basics here : Changing tool dialog appearance I want to change the height on one element, the only ...
3
votes
2answers
102 views

How do updateParameters and updateMessages Interact in a Python Toolbox?

I have been developing a Python toolbox which consists of 6 parameters. I have received immense amounts of help on this through StackExchange through the following posts: How to Determine if a Layer ...
3
votes
1answer
455 views

How to perform Tool Validation in Python Toolbox?

I'm trying to make sure there is no '-' in the output filename, and if there is, to set an error (circle with the red 'X') so that the tool can't be run, and have a tooltip that explains the issue. ...
3
votes
1answer
107 views

How do I use variables inside a arcpy toolbox function? [closed]

I have a point file and I need to make a lot of buffers in specific increments but I can't figure out how to interate through a list inside the buffer function. Here is what I have: import arcpy ...
3
votes
1answer
129 views

Python MemoryError when running ArcGIS Python Toolbox tool

I have a Python Toolbox (.pyt) containing a single tool. Part of that tool is the following function, which creates a dictionary from an attribute table, where the keys are the rows' OBJECTIDs and the ...
3
votes
1answer
1k views

How to use a feature set as an output parameter in a Python Toolbox?

I'm having trouble setting a "Feature Set" output parameter from a .pyt .. I'm using ArcGIS 10.1 SP1. Here’s a short script that can be invoked either from a classic toolbox (thru the main() ...
3
votes
0answers
36 views

Can one parameter choice on Python toolbox tool set Display Names of other parameters?

I would like to be able to create a Python toolbox tool (or a Python script tool) where a choice made from the first parameter (Category in the images below) changes the Display Name of other ...
3
votes
0answers
24 views

Configuration problem anaconda python in ArcGIS

I used Eclipse with PyDev to create a script in Python (windows 7 x64). My code runs perfect when I start the run in Eclipse, but when I add it as a Tool in ArcGIS 10.1, I have the following problems: ...
2
votes
1answer
105 views

How I can do event with two clicks using python add-in wizard?

How I can do event with two clicks using python add-in wizard, I have found a way to do event with one click by adding a New Tool in the wizard, but I need "first click To copy the attributes from ...
2
votes
2answers
58 views

Python Tool Not Opening

I know that this is definitely an ambiguous question. However, I initially had my Python toolbox working great. I then wanted to have additional functionality with it and added some more coding. ...
2
votes
2answers
156 views

Specify geoprocessing service connection at publish

I have a geoprocessing service published from a tool written in Python and contained inside a Python toolbox. I need to be able to publish this service in multiple environments (production, staging, ...
2
votes
1answer
88 views

Tutorial on creating python toolboxes?

I've done the ESRI training: Creating Python Toolboxes Using ArcGIS 10.1 but is there anything more in depth? Since VBA is no longer supported in ArcMap 10 and up I'm trying to convert a cross section ...
2
votes
2answers
101 views

ArcGIS - Getting Python toolbox to function properly

as the header says, I do have a problem in getting my toolbox to function the way I want it to. In the following my parameter definition is shown, where from I would expect to get only feature classes ...
2
votes
1answer
411 views

How to convert Python (ArcPy) script into tool or toolbox script?

I've written a simple python script that allows me to quickly create a copy of a template Mxd, pointing to different shapefiles. The user specifies the new location, a name for the new mxd, then the ...
2
votes
1answer
62 views

Can Python toolboxes be used with ArcObjects GeoProcess.AddToolbox?

Can Python toolboxes be used with ArcObjects GeoProcess.AddToolbox? I'm trying to execute a tool in a Python toolbox (.pyt) from .NET. First I call: GP.AddToolbox(@"C:\path\to\MyToolbox.pyt") ...
2
votes
1answer
99 views

How to find missing dependencies in a distributed ArcGIS Python toolbox?

I am developing a Python Toolbox that uses a few external libraries (ogr/gdal, matplotlib, shapely, reportlab among others) which files I have directly copied in the same folder as my toolbox .py, as ...
2
votes
1answer
731 views

arcpy FieldMappings for Spatial Join

I'm trying to create a python script tool to use within ArcMap 10.1. I created a Model and exported it as a python script and added custom field mappings for the first Spatial Join by reading through ...
2
votes
1answer
110 views

Re-Distributing Python Toolbox

After reading this Esri article on how to distribute Python Toolboxes, I'm wondering how redistribution works? I have a few toolboxes that are in constant development, but would be useful to my ...
2
votes
2answers
716 views

ArcGIS 10.2 Geoprocessing Service based on Python Fails with IOError: “SDE” does not exist Failed to execute

I have a Python Script that inserts X,Y Point in the SDE Point Feature Class. It works fine when executed in ArcMap 10.2, but it fails with IOError when published as Geoprocessing Task service in ...
2
votes
2answers
143 views

'DEFeatureClass' vs. 'IFeatureClass'

I'm writing an ArcGIS 10.1 .pyt toolbox to accept a feature class as input (not a shapefile). Referencing ESRI's online guide to 'Geoprocessing Data Types of Parameters and Environments' [PDF ...
2
votes
2answers
59 views

How to Change Parameter Type from Optional to Required

I am creating a Python toolbox with 5 parameters. One of the parameters is a Boolean/checkbox, which checks if the user wants to edit the labels of a shapefile. What I would hope to do is if the user ...
2
votes
1answer
51 views

Parameter Not Being Included in Tool

I have been attempting to make a Tool within a Toolbox with four different parameters. My code consists of the following: def getParameterInfo(self): """Define parameter definitions""" # ...
2
votes
2answers
281 views

How to remove temporary layers so they don't show up in parameter lists

ArcGis 10.2, arcpy. I have several tools in a Python toolbox that have a feature class parameter. The parameter is defined as parameterType = “GPFeatureLayer”. When running several tools in ...
2
votes
1answer
641 views

How to define a Feature Set parameter for an ArcGIS python toolbox tool?

I'm trying to create an ArcGIS python toolbox tool which use a polygon for input. I want the user to be able to create the polygon when the tool is run. I know how to do this using both a ...
2
votes
1answer
203 views

Getting null values using Point sampling tool in QGIS 2.0.1

I would like to obtain the information of a raster layer at some points. Apparently the Point sampling tool does the job. I have used this tool, and all the raster values extracted at specific points ...
1
vote
3answers
224 views

Filtered list in ArcGIS toolbox

My goal is to grab a bunch of feature classes, select the first feature class, list the fields, and return that list to parameter 1 as a filtered list. My ArcGIS toolbox is setup with 2 parameters. ...
1
vote
2answers
924 views

Select Layer by Location - Arcpy - Why are my inputs being interpreted as invalid?

I am working on a tool in a python toolbox and am totally confused about what is going on and causing my select by location operation to fail (Error 000368). I am trying to select the features in one ...
1
vote
1answer
138 views

Multivalue parameter as text in Python toolbox - reading in to imported module function

I'm building a Python toolbox with a tool which calls specific functions from a custom module. The main input parameter for this tool is a multivalue list of raster layers. In the execute block of ...
1
vote
2answers
353 views

Median value for a case within ArcGIS 10.1

Similar to this post (ArcGIS median value from a layer) I am looking for a toolbox to get the median value for a data field by a case. For example, say I have dataset with percent tree cover for each ...
1
vote
2answers
40 views

Optional Parameter Not Being Optional in a Toolbox

I have been creating a toolbox that contains 4 parameters. Two of my parameters involve editing the labels of a shapefile. I want to have these two parameters as optional: if the user does not want to ...
1
vote
1answer
64 views

How to generate a choice list (dropdown) in a toolbox that will allow the user to select a field in a csv as input?

I need to input a csv as parameter 1. Parameter 2 should be a dropdown displaying the various fields (the headerline) where I can select a column to use for geoprocessing. Param1: c:\my.csv ...
1
vote
1answer
28 views

Short list of .prj options in .pyt

I'm tasked with creating a .pyt to distribute across our office and field computers (state geological survey) for converting .gpx to features but constraining the choice of projections/datums to seven ...
1
vote
1answer
65 views

How do I use a server data store with a Python toolbox? [duplicate]

ArcGIS Server lets you set server side data stores: This is nice. I can use one connection on my local machine and another on my server. (Right? Please tell me I'm right.) But for the life of me, I ...
1
vote
1answer
122 views

geoprocessing service via python toolbox script, local versus server paths

So I feel like I'm missing a very basic concept when it comes to publishing python toolbox scripts to a geoprocessing server. I've scoured the ArcGIS online help (not saying I've read everything, and ...
1
vote
1answer
85 views

Python Toolbox (.pyt) Tool Output Layer Name

How can I manipulate the TOC display name of my output parameters when using a Python toolbox (.pyt) Tool class. I tried adding a symbology layer, however this has no affect on the TOC name. Is it ...
1
vote
2answers
174 views

Prevent parameter defaults in service definition file

I have a Python toolbox with a single tool designed for 10.2. The tool is intended to be a geoprocessing service on a server. So I run the tool, and after it succeeds, I right click the result and ...
1
vote
1answer
138 views

Model Builder: Enable / Disable parameters based on Conditions / Preconditions

I have been working with Model Builder and am having trouble placing a precondition on an input parameter. However, I may be going about it in the wrong way and may just need a Python script. My ...
1
vote
1answer
292 views

How to use 'remap' in reclassify tool code in ArcGIS Python Toolbox

I am making a reclassify tool in ArcGIS python toolbox (.pyt) ... I am able to use the remap datatype but am not able to parse the information present in Remap in the Reclassify function's third ...
1
vote
1answer
388 views

XY event layer doesn't work with ArcGIS Server 10.1

I have a geoprocessing tool written in Python that contains operations on an XY event layer. It worked perfectly when running from ArcCatalog. When published as geoprocessing service on ArcGIS Server ...
1
vote
0answers
21 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
0answers
57 views

Esri Python Toolbox(pyt) corruption in ArcToolbox.dat

Symptoms: Open ArcCatalog and all tools within Python Toolbox(pyt) have a red-x error next to them claiming that "Arcpy module has no attribute Parameter" Close ArcCatalog Delete ArcToolbox.dat file ...