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

learn more… | top users | synonyms

1
vote
1answer
29 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 ...
3
votes
0answers
17 views

How to get points digitized in WAB geoprocessing widget back over to original coordinate system for calculations?

This is a follow-up question to a previous post. The following Python Toolbox tool accepts one or more points from the user and calculates the station, offset, and orientation of the point(s) based ...
2
votes
2answers
36 views

Is it possible to have two input feature layers and a derived output feature layer in an 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 ...
2
votes
0answers
27 views

Problem creating Python Toolbox in ArcGIS

I am trying to create a Python toolbox (pyt). I right click the folder, select New and click Python toolbox. This returns an error dialog box: "failed to create the toolbox file". Although a ...
0
votes
1answer
194 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
163 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
80 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 ...
0
votes
0answers
84 views

Creating a custom toolbox and python script to analyze fire data [on hold]

My goal is to create both an ArcGIS toolbox and an independent python script to do the analysis of fire occurence in the Southwest (by season) through ArcMap as well as independently with python. I ...
1
vote
1answer
29 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
65 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
835 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. ...
0
votes
0answers
25 views

IDE's that play well with python toolbox [closed]

I recently have learned about creating python toolboxes, and watched the video from ESRI. In the video I noticed that they were utilizing a pywin ide. Which brings me to my question can you use any ...
1
vote
1answer
65 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?
20
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
21 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
35 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
542 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
47 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
32 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
56 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
113 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
42 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
47 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
218 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
61 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
85 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
1k 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
461 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
366 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
57 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
44 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
93 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
66 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() ...
5
votes
2answers
285 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
433 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
802 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 ...
11
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
208 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
175 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
177 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
133 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
188 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. ...
2
votes
1answer
56 views

Only Black & White text in Python editor in ArcGIS for Desktop?

When opening IDLE or Pyscripter in ArcGIS by right clicking on a toolbox and Edit... the specified editor opens with the code - BUT all text is only black and white not the context colors of blue, ...
4
votes
1answer
131 views

Setting “Always run in foreground” within ArcPy code?

Is it possible to set the "Always run in foreground" option within ArcPy code? I haven't found anything on this yet? It would be nice to be able to specify within a script, instead of through the ...
0
votes
0answers
279 views

Generating choice list (dropdown) in toolbox to allow user to select field in CSV as input? [duplicate]

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 ...
0
votes
0answers
50 views

Python toolbox - get lat and long from tables

The objective of the python toolbox is to convert a bunch of tables to point feature classes. The user selects the tables (parameter 0 - multivalue). The user selects the output workspace where the ...