Python toolboxes are created entirely using Python in ArcGIS for Desktop and stored as *.pyt files

learn more… | top users | synonyms

3
votes
1answer
47 views

Defining a required output field parameter for an existing or a new field

I need to define a required field parameter, and I'd like it to work with both existing and new fields, i.e. regardless of whether the field already exists. The problem is, if I enter a new (non-...
4
votes
0answers
251 views

ArcGIS python toolbox: GPFeatureLayer parameter “loses” symbology type [closed]

I'm pretty new at ArcGIS python toolboxes. Here is one problem I've been fighting with for a while. I want to create an output layer (GPFeatureLayer) with a specific symbology (GRADUATED_COLORS) and ...
0
votes
1answer
60 views

How to access output parameters from a Python Toolbox Tool called by .NET?

I am trying to access an output parameter from a Python toolbox tool and cannot find any information about how this is done: I am developing an Esri Add-In for ArcGIS 10.1 SP1 for Desktop (Build 3143)...
1
vote
1answer
394 views

Returning feature class from Python toolbox

I am trying to return a feature class (my sample data is a polygon fc) from a Python toolbox and cannot find any information about what I have to set to get it to work. This runs successfully and ...
0
votes
0answers
15 views

Using filter with an optional parameter

Is it possible to set a filter on an optional parameter in ArcGIS PYT toolbox? All examples I've seen (http://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/defining-parameters-in-a-python-...
4
votes
1answer
78 views

How to get fieldnames in a value table depending on the input value

I would like to add a parameter as value table with one of the fields being a value list. The value table consist of 3 columns, namely "table","field","description", whereas "field" is a value list. ...
1
vote
1answer
57 views

How to add a script tool in a toolbox without the Add Script Wizard?

I have been put on a project where I need to modify and optimize an existing PythonToolbox and associated Toolbar (each button calls a script). I want to add a new script tool in there but the Add ...
4
votes
1answer
41 views

Getting points digitized in Web AppBuilder geoprocessing widget back over to original coordinate system for calculations?

This is a follow-up question to Having two input feature layers and derived output feature layer in ArcGIS Python Toolbox tool?. The following Python Toolbox tool accepts one or more points from the ...
3
votes
2answers
106 views

Having two input feature layers and derived output feature layer in ArcGIS Python Toolbox tool?

I'm unable to find an example of an ArcGIS Python Toolbox similar to the one I'm trying to get to work. The standalone python script works beautifully. Turning it into a Python Toolbox so I can use ...
1
vote
1answer
67 views

Python Script GetParameterAsText?

I am writing a python script to be added to a toolbox and I do not know how to call an existing tool to be a parameter. import geocoder ##geocoding library import csv import arcpy ##...
0
votes
1answer
244 views

How can i automatically display the output of my toolbox?

i have made a python toolbox (.pyt file) and run it in Arcgis 10.1. The Output is a raster and I want it to automatically show up in the Arcmap viewer. The option for displaying the output of ...
2
votes
1answer
179 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""" # ...
1
vote
2answers
90 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
42 views

Creating new layer in ArcGIS for Desktop with Python Toolbox?

I would like to create new shapefile layer or memory layer with one point with certain coordinates in ArcGIS 10.2 with Python Toolbox. Which function should I use? I wrote this code: import arcpy ...
4
votes
1answer
2k views

Defining Feature Set parameter for ArcGIS Python Toolbox tool?

I'm trying to create an ArcGIS Python Toolbox tool which uses 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 ...
1
vote
0answers
74 views

Command works in Console, but not in Python Toolbox

I want to create a memory layer with points in ArcGIS with Python Toolbox. I found an in_memory function. Here is the question: Why this command works in Python Console in ArcGIS, but not in Python ...
1
vote
3answers
1k 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
1answer
90 views

Multi Input Python Toolbox in Arcgis

I use Python toolbox in arcgis, it is possible to add a multiple input file table? And is possible to filter input files allowed by extension?
21
votes
3answers
3k 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 ...
0
votes
0answers
22 views

Save update feature class (Python toolbox)

I created a Python Toolbox tool to reorder fields I am trying to save the feature class determine path,any advise? here is acode I'm trying: import arcpy import os class Toolbox(object): def ...
3
votes
1answer
56 views

Script tool Error - ERROR 000735: Y Field (Latitude): Value is required Failed to execute (ConvertCoordinateNotation)

I've a python code which was working in ArcGIS 10, but now since I've migrated to 10.2.2 didn't work.Basically it's a toolset which runs a python script. The tool allow the user to input coordinates ...
2
votes
3answers
725 views

arcpy.mapping.MapDocument(“CURRENT”) fails when running python script in background as tool

The engineers I work with have requested an autosave feature for ArcGIS, so I thought I'd make them a python tool that routinely saves. The script works fine when run in the foreground, but fails when ...
1
vote
1answer
51 views

Choosing “method” in Python Toolbox

I am trying to make these two methods variable, so the user could choose which method he wants to use. If the one with 3 classes or with 5. arr = arcpy.da.FeatureClassToNumPyArray(in_features, ...
1
vote
1answer
37 views

Private functions in Python Toolbox

Is it OK to have private functions in a python toolbox? I know it's possible because I tried. But I don't know if that's OK, I haven't seen anything in the Internet where someone from ESIR is using ...
1
vote
1answer
86 views

Spatial Join in Python Field Mapping with Multiple Merge Rules

I'm performing a Spatial Join with a polygon (target) and a point (joinFeature)- which has 5 fields in it that I need to "sum". I have written a Spatial Join and (after many long days) gotten the ...
2
votes
2answers
120 views

ArcPy Calculate Null Values to Zero in Multiple Fields

I have a table that has Null values and I would like to insert a portion in my script to calculate these Null values to 0 in only a few of my columns in my table. Here is my script so far: with ...
0
votes
1answer
62 views

Populating the drop down of GPValueTable

In a Python Toolbox the user has to select a city from a list of 50 world cities. More than one city can be selected. The best UI control for that would be Autocomplete / Autosuggest, but since this ...
3
votes
1answer
1k views

Field Filter and Value Pick List for a Python Toolbox ValueTable Parameter

In an ArcGIS Python Toolbox (pyt file), how do I specify a filter for a Value Table parameter? In my value table I have two columns. The first is a a field name derived from a selected table view and ...
2
votes
2answers
51 views

Setting Python Toolbox Parameter to None without making current selection value unselectable thereafter?

I'm making a python toolbox and it has an input parameter of type GPFeatureLayer. Let's call it my_param. In updateParameters when my_param.altered, its value is added to a value table. Then I'd ...
3
votes
1answer
311 views

Creating a ValueTable with a column that has dependency

I am creating a python tool which looks like the figure below. Input feature: It asks for a input feature class. Valuetable(Lookup tables): It has two columns - one for look up tables and another ...
2
votes
1answer
69 views

Disable column of Value Table in Python Toolbox?

Can I disable a column based on another column? Let's say I have a column to choose a field type (Short, String and so on) and a second column to choose the max length of a string. I would like to ...
2
votes
1answer
137 views

How to properly handle a multi-column value table in an ArcGIS Python toolbox?

I am building a relatively simple python tool for ArcGIS 10.3 which will automate the process of generating summary statistics for multiple raster datasets, for polygons in a polygon dataset, using ...
7
votes
1answer
2k 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 ...
5
votes
1answer
573 views

Debugging AttributeError: 'module' object has no attribute 'Parameter' from Python Toolbox of ArcPy?

I have a big .pyt script (python toolbox) and now i trying split it to many files (1 file - 1 tool). In single .pyt file everything works perfectly, but when file is splited i get this message: ...
3
votes
3answers
495 views

why is python toolbox script not working standalone in PyScripter?

I am learning Python Toolboxes with PyScripter. I have a test python toolbox that outputs a raster file. It works when run from ArcCatalog. As I understand it, it should also run standalone within ...
2
votes
0answers
62 views

Altering input files in a Python toolbox? [closed]

I'm trying to add a temporary field to one of the input feature classes in my Python toolbox. arcpy.AddWarning("Adding field of type " + fieldType.upper() + " to FC " + varFC + " called " + ...
1
vote
1answer
53 views

Graph preview in Python toolbox

I need to create a toolbox in python, which will be used for making graphs. I need the parallel preview window during the graph creation. Half of the screen will be used for settings the parameters ...
2
votes
2answers
149 views

AttributeError: 'Layer' object has no attribute 'listLayers'

I want to use the result of OD cost matrix for my further calculations. However, whne I try to extract the sublayer "lines" it returnes an error AttributeError: 'Layer' object has no attribute '...
1
vote
2answers
73 views

How to get and create featureclasses in Python toolboxes?

I'm writing my first python toolbox. I know there's a way to do this in batch processing, but for proof of concept I want to write this pyt tool to call the Clip tool and add the resulting ...
4
votes
1answer
2k 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() function;...
5
votes
2answers
357 views

Python toolbox tool objects do not remember instance variables between function calls?

I am developing a Python toolbox, and came across a peculiar behavior: The tool objects does not remember any instance variables between function calls. Consider this code: import arcpy class ...
6
votes
2answers
456 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?
7
votes
1answer
910 views

Python toolbox works in ArcToolbox and in Python console, but not in ArcCatalog

I have a set of Python tools in a Python toolbox (.pyt). They are broken into multiple files and modules and have been functioning correctly, but now I'm seeing inconsistent behavior on multiple ...
9
votes
3answers
3k views

Defining parameter descriptions for Python Toolbox help?

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 ...
12
votes
1answer
3k views

Guidelines for organizing Python Toolboxes (.pyt) in ArcGIS

For one of my tasks I need to create a Toolbox with three tools (python scripts). Instead of ordinary tbx I've decided to write it as Python Toolbox (pyt). Everything is clear except the "good" way ...
0
votes
2answers
224 views

Getting parameter defined in one tool to another tool in same Python Toolbox?

This is what I am looking for: Create two tools in Python Toolbox: Tool1 and Tool2 (I am able to do that) I want to define a parameter in Tool2 whose value depends on parameter entered by user in ...
8
votes
1answer
190 views

Do ArcGIS Pro tasks support Python Toolbox tools which operate on Map Frames?

Do ArcGIS Pro tasks support Python Toolbox tools which operate on Map Frames? The reason I ask is that I am stuck when trying to do the following: Start ArcGIS Pro 1.1.1 Create a new project - I ...
3
votes
3answers
220 views

Forcing Python Toolbox tool to break loop and do cleanup when user clicks Cancel?

I am writing a Python tool that perform heavy tasks in a loop. When the user clicks "Close" I want to break the loop, perform some cleanup, and then finish. Consider this example tool that counts ...
0
votes
0answers
188 views

Geprocessing Service: ERROR 000816: The tool is not valid. .Pyt file is fine but .tbx has red x's

I have a .pyt Python toolbox which runs fine in ArcMap and then gives the dreaded "ERROR 000816: The tool is not valid" when published as a GP Service. I've dealt with this issue many times before, ...
3
votes
2answers
198 views

Problem creating parameters for a tool

I am still an arcpy newbie, but I think I have a basic understanding of fundamentals including syntax, variables, modules, etc. My question is regarding the usage of parameters while creating a tool. ...