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

learn more… | top users | synonyms

2
votes
1answer
45 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 ...
8
votes
1answer
153 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 ...
0
votes
0answers
86 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
3answers
137 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 ...
3
votes
2answers
159 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. ...
1
vote
3answers
233 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
1answer
45 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, ...
3
votes
1answer
83 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 ...
2
votes
1answer
69 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 ...
0
votes
0answers
42 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 ...
1
vote
1answer
43 views

Datatype and filter for a SDE connection parameter in a Python toolbox?

I have a tool in a Python toolbox. As a parameter, I want to let the user select an existing (or possibly create a new) SDE connection. What value for datatype should I use for this? I have tried ...
2
votes
2answers
42 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 ...
0
votes
1answer
88 views

How to set parameter dependencies in ArcGIS python toolboxes

I'm trying to build a python-toolbox where the user selects a layer and then specifies a column in that layer. According to the documentation, that is done via the parameterDependencies attribute of ...
2
votes
1answer
54 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 ...
1
vote
2answers
58 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 ...
3
votes
1answer
76 views

GeoProcessing Tool Parameter: CoordinateSystem vs SpatialReference

So I'm adding a couple tools to my python toolbox. Most of the time I just used CoordinateSystem and leave good enough alone. Today I tried SpatialReference and noticed the result is the same. The the ...
1
vote
2answers
48 views

how to export fclist and fccount to csv

i am looking for a method by which i can export fc list and fc count into xls or csv. for example i have 3 featureclass in Scratch.gdb. 1.PaLakh 2.PATest1 3.Point i want all 3 of these ...
1
vote
2answers
185 views

How to pass only selected features in python toolbox

I have a feature class in a file geodatabase. I want to select features from the feature class and export their attribute to an excel sheet. I need a python tool in ArcGIS which does this. My problem ...
1
vote
1answer
87 views

How to create an ArcGIS toolbox programmatically?

Is it possible to programmatically create an ArcGIS toolbox? The aim is to write a plugin that works in ArcGIS and have a single source for the tool parameters which is then compiled to an Arc ...
3
votes
1answer
132 views

Downgrading WRF Hydro GIS Pre-Processing Tools 2.2 to work with ArcGIS Desktop 10.0?

I have just come across the WRF Hydro GIS Pre-Processing Tools for the first time. The version I am looking at is 2.2 and its documentation says: The processing workflow for creating WRF-Hydro ...
3
votes
0answers
49 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 " + ...
0
votes
2answers
179 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 ...
1
vote
3answers
288 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
223 views

Select from a list of string variables in a custom Python ArcGIS tool?

I've made a few Python tools for ArcGIS lately and haven't had to use this idea in my tools until now. I am making a looong tool that will deal with 13 different districts worth of data. I want the ...
3
votes
1answer
145 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 ...
1
vote
1answer
108 views

How to publish python toolbox with lots of tools in ArcGIS Server 10.3?

I have python toolbox with like 40 tools and I need a quick way to publish the whole toolbox. I found some instructions in the documentation, they state that every tool should be executed and their ...
1
vote
2answers
173 views

Creating tool in Python toolbox to export field list to Excel?

I am creating my first tool in a Python Toolbox (*.pyt) to export a list of fieldnames to Excel. I have the following bits of code: import arcpy class Toolbox(object): def __init__(self): ...
0
votes
1answer
87 views

Creating Python Toolbox (*.pyt)?

I would like to create a new shapefile based on input. My input is DATE parameter. This is my code for input parameter: param = arcpy.Parameter( displayName="TARIKH", name="date_feature", ...
0
votes
0answers
37 views

updateParameter() python toolbox

I can't update parameters in my Python Toolbox and I don't understand why. Someone can help me with this example code? class Tool(object): def __init__(self): self.label = "Tool" ...
2
votes
1answer
39 views

Searching for value in layer without opening MXD file?

As part of the validation for parameters of a Python toolbox, I need to check if the text in parameter #1 is exists in a layer in a MXD file selected as parameter #2. Currently, I use this code in ...
0
votes
0answers
30 views

Select Data in ModelBuilder Error 000622 and 000800

How to build a model takii way to avoid this error? I need to layer the missing tool is created automatically or miss it and extending those layers in MXD are available in gdb ... More specifically, I ...
5
votes
2answers
212 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 ...
0
votes
0answers
35 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?
0
votes
1answer
108 views

Is there a script to Python for Click to toggle selectable?

I cannot write a script using ArcPy (Click to toggle selectable). To make a layer unavailable for sampling! I just need to create a tool to automate several processes, one of them is the ability to ...
0
votes
1answer
73 views

TypeError: unsupported operand type(s) for *: 'float' and 'geoprocessing Layer object'

I am getting a rather unclear type error, and after searching online I cannot find any solutions that help. I am trying to create my own python toolbox for wifi router signal loss, and I am trying to ...
0
votes
0answers
40 views

How to build a raster populated with an equation in a python toolbox?

I am working on creating a python toolbox to solve for WiFi signal properties based on various inputs, and for the end result I would like to have the output in the form of a raster. I need this ...
1
vote
1answer
79 views

Python tools won't open when clicked on

I am creating a python toolbox within ArcGIS 10.3 and I am having issues opening it up in ArcMap. I have been editing it, saving it, and running it within ArcMap this whole time to test it little by ...
2
votes
1answer
225 views

Python toolbox - keep parameter value updated after re-altering parameters

I am writing a Python toolbox with (among other) 3 parameters: 2 boolean (check boxes) and 1 string. The string parameter's properties depends on the 2 booleans' value: If at least the first boolean ...
0
votes
0answers
70 views

Validating derived parameters for ModelBuilder and Python Toolbox?

I'm working on a tool in a Python toolbox and I'm running into trouble getting the output tables to work in ModelBuilder. The tool takes an input table view and ultimately uses the Table Select ...
2
votes
0answers
149 views

Updating Field Mappings Parameter on table selection in Python Toolbox?

I am building a python toolbox with ArcPy and would like to associate an input feature class parameter with a field mapping, so that once user selects the input feature class the field map populates ...
7
votes
1answer
627 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 ...
1
vote
0answers
77 views

Configuring Python to avoid conflict with ArcGIS for Desktop (ArcPy)? [duplicate]

I am trying to find the best way to configure a new version of python in my computer (windows) so that I do not have any problem with the python version that I have with ArcGIS. Is there anyway to ...
1
vote
1answer
88 views

How can I programatically set the “Description” for a ArcPy Geoprocessing Service?

When I create a Python Toolbox (pyt), I set the name and description of the toolbox. When I create the parameters, I can set their name, type, default value, in/out, etc. Basically, everything that ...
1
vote
1answer
57 views

Field calculater in Python console from QGIS

I have some doubts in syntax of processing.runalg(qgis:fieldcalculator) in python console of QGIS. I want to create a new field in a shapefile and calculate this formula: [D_PATRICIA]*1000. ...
1
vote
1answer
216 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 ...
3
votes
2answers
260 views

ArcGIS tool for graph analysis

I have a road network shape file. After creating Network dataset I get a graph with vertices and edges. I need to create a tool for ArcGIS (through a Python code) which enables to calculate depth of ...
0
votes
0answers
77 views

Problems with using python script in ArcGIS for Server 10.1

I have a geo-processing model that works perfectly in ArcGIS desktop (10.1) and successfully publishes as a GP Task to ArcGIS Server (10.1). Once I try to execute the GP task (either through a widget ...
1
vote
1answer
102 views

How do you use Windows folders as acrpy Parameters

I am having problems trying to perform simple folder management operations in an ArcGIS python toolbox. First here's some code snippets (I have left out all of the stuff that does not pertain to this ...
0
votes
0answers
289 views

Python toolboxes missing (Can't use ArcGIS 10.2.2 toolboxes)

I was trying to use Hot Spot Analysis Toolbox on ArcGIS 10.2.2 but this error message appears: updateParameters Syntax Error Runtime error Traceback (most recent call last): File c:\program ...
0
votes
0answers
81 views

Creating a custom toolbox and python script to analyze fire data

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 ...