Questions tagged [python-toolbox]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
31 views

Updating ValueTable parameter of ArcPy Python Toolbox tool

I have a shapefile and I want to calculate multiple fields using the GP ValueTable parameter. The script loads field names from a layer, then I should delete rows I don´t want to calculate and then I ...
2
votes
0answers
40 views

Publish geoprocessing service from Python Toolbox to ArcServer 10.7 from ArcMap

I have been trying to publish a python 'Hello, World!' sample geoprocessing service. I have ArcMap 10.7.1 and ArcGIS Enterprise Server 10.71. In Arc Map I started with a new Python Toolbox, and ...
-1
votes
0answers
28 views

Setting Spyder to recognize .pyt extension when using ArcPy

I am trying to develop python toolboxes in ArcGIS Pro and am using Spyder as my IDE. I would like to open the .pyt file in Spyder and use python syntax highlighting, but cannot figure out how to ...
1
vote
1answer
29 views

FeatureClass error message when running ArcGIS Python tool

I am trying to remove rows from a feature class that is included in a python tool in ArcGIS 10.7. I have run the code as an independent Python script and it runs fine, but when I run the following ...
0
votes
1answer
20 views

Set geodatabase as outfolder in ArcGIS 10.7 when creating tool in Python toolbox

I am trying to specify a file location for an output file when creating a python toolbox tool, but the tool continues to output the file to the default geodatabase. I have tried to set the env....
0
votes
1answer
40 views

ArcGIS Python Toolbox expression on Portal (Web Tool in Web App) problem

I wrote a GP tool (Python toolbox) with Expression using GPSQLExpression with updateParameters that manipulates the expression, it works fine on ArcGIS Pro (2.4), but it becomes a String Input on Web ...
0
votes
2answers
57 views

Definition queries in Python Toolbox tools

I'm trying to set a definition query within a Python Toolbox tool in ArcGIS Desktop. The code below works when I run it in the ArcGIS Python window, but does not perform the definition query or ...
-1
votes
1answer
27 views

Orfeo ToolBox is not working properly in QGIS 3? [closed]

I have installed QGIS 3 and Orfeo ToolBox in it. The toolbox is not working properly. Is there any way to use it in ArcGIS 10 with Python 2.7?
1
vote
1answer
34 views

Accessing the feature layers inside a geodatabase using ArcPy

In an Python Toolbox I have a parameter that gets the location of a geodatabase input.gdb which has several layers of input data. contextual_data_param = arcpy.Parameter( name="context", ...
1
vote
1answer
81 views

How to recompile a Python toolbox after a change to an imported module

If an ArcPy toolbox imports modules that are edited, recompiling the modules from the .py source code to the .pyc code that actually runs is a challenge. Deleting the .pyc files doesn't work because (...
0
votes
0answers
31 views

Allow null values from Value Table filter list in Python toolbox parameter

I'm setting up parameters in a Python Toolbox and have a Value Table with three columns. Two of the columns have value lists for the user to pick from. I would like for the user to be able to choose ...
1
vote
1answer
32 views

Python Toolbox Value Table Parameter - getting separate outputs for different column inputs

I'm using a Value Table as a parameter for a Python toolbox so the user can input two related attributes. I'm struggling with how to use the values the user inputs as separate values/parameters. The ...
2
votes
1answer
35 views

Is there a text box parameter type for Python Toolboxes?

The Calculate Field tool has a text box for code. Is there a parameter type for Python Toolboxes for this type? There's String but it's just one row of text. in_str = arcpy.Parameter( ...
4
votes
0answers
50 views

Set default values when value is added to value table in Python Toolbox tool

Similar to Set default values for value table in Python Toolbox tool, I'm trying to populate a value table with default values. However for the linked question the value table is populated once an ...
0
votes
1answer
122 views

Defining parameters for Python Toolbox tool in ArcGIS Pro

I have been posting similar questions recently, but I found a template code for a Python toolbox and I would like more help. I am trying to create a tool in ArcGIS Pro that takes parameters from ...
2
votes
0answers
23 views

Variable type for Value Table parameter in Modelbuilder?

I've created a python tool with a multivalue input box (parameter type: GPValueTable). The box is small and will contain long strings. I'm hoping to be able to add values to the input box with ...
1
vote
0answers
42 views

Using Python dictionary as parameter and variable in Python Toolbox tool of ArcPy [closed]

I'm building a feature class merging and comparing toolbox in arcpy, ArcGIS 10.7. I have a working command line utility with fixed featureclass values, and now I'm building this toolbox, I just copy ...
2
votes
1answer
57 views

Parameter dependencies based on two datasets in Python toolbox

I am setting up the parameters in a Python toolbox. I have a parameter that I would like to list fields based on a user input feature class. I am wondering if it is possible to list fields based on ...
2
votes
1answer
110 views

Python Toolbox Value Table values and list inputs

I am trying to create a Value Table I will use to create a field mapping object. First column will represent the target field, second column carries the source field. The first column is populated ...
1
vote
1answer
50 views

List fields in parameters from Fc list in script validation using arcpy in arcgis

I am trying to list fields from a feature class list in script tool validation. First user selects the data frame from the list then FC populates in next box and fields of the FC in next box. I have ...
0
votes
0answers
46 views

Using script parameter validation in ArcPy

I am developing a script to Add, Delete, and Update rows within a table. The script basic function works well using InsertCursor and UpdateCursor. My questions or troubles come when I attempt to use ...
1
vote
1answer
126 views

arcpy.Parameter : how to create “The interactive feature input control”?

I am using ArcMap 10.5, but help pages I am referring are the same as in 10.7. I am trying to make a GP tool within Python toolbox with kind of selection input: user selects features in ArcMap ...
4
votes
2answers
136 views

Python Toolbox - Only update parameter when specific parameter changes

I'm creating a Python Toolbox. One input is a workspace and the second is a list of feature classes and tables. The list of feature classes and tables is generated once the workspace is input by the ...
2
votes
1answer
77 views

Calling a Class from Another Within a Python Toolbox

Using the example below, both ToolOne and ToolTwo have two parameters each, and are independent functions in their own right, but also form the basis for a chain of functions for an output. I am ...
1
vote
0answers
98 views

Field Mappings control doesn't show the Add Input Field in the context menu of a Python Toolbox

I’m trying to build a Python Toolbox which uses a Field Mappings control (GPFieldMapping parameter). For some reason I don’t manage to get the same behaviour of the Field Mappings control as in the ...
2
votes
1answer
181 views

Unable to load layers created with Processing Toolbox PyQGIS 3

I figured out that besides from the python editor within QGIS, the layers that I'm creating with a Processing Toolbox are not saved and displayed in my .qgs projects. --> see image: 1) what I get ...
0
votes
1answer
38 views

Script that works in Python Toolbox not working in Standard Toolbox?

This script does not work in a Standard Toolbox but it works in a Python Toolbox. Do I need to delete all the parameters from the script? import arcpy, os, sys, shutil class Toolbox(object): ...
2
votes
1answer
115 views

Getting parameters of Python Toolbox tool to appear in ArcGIS Pro?

I can't get the parameters of my tool to show up in ArcGIS Pro 2.1 Because of my work I can't put my exact code here, but I'll put the skeleton of what I'm doing and hopefully someone can see what I'...
3
votes
2answers
112 views

Saving Python objects into memory for repeated use of Python toolbox?

I have made a Python toolbox which processes relatively large polyline feature class (millions of features), builds a network graph from it as dictionary of lists, and depending on user selected ...
1
vote
1answer
85 views

Deriving field parameter from table parameter in Python Toolbox?

I'm trying to derive a Python Toolbox parameter from another parameter. I'd like to have a tool which determines fields from an input table and applies the list as a filter to a second parameter. This ...
4
votes
1answer
83 views

Limiting Input Parameter to only File Geodatbase in Python Toolbox?

I've been working with ESRI Python toolboxes for a while but I'm still having difficulties setting an input parameter as a "DEWorkspace" and using the parameter filter to make it so only file ...
0
votes
0answers
34 views

What analysis tool I can use to identify the relation between points and areas

I want a binary result for each purple point in this map, i.e. whether in or out od the blue polygon areas? In this case, one is in and the other is out. What analysis tool in ArcGIS Pro (also arcpy ...
4
votes
2answers
401 views

arcpy.GetParameterAsText not passing arguments to script?

I have been working on an ArcGIS Python script tool which takes the co-ordinate system from an input raster and reprojects a vector to the same co-ordinate system. The script works fine when i hard ...
0
votes
2answers
98 views

ArcGIS 10.5 Python toolbox problem SelectLayerByAttributeERROR 000358: Invalid expression Failed to execute

I am trying to create a .pyt that find and select an object in an specific layer but I have a problem. I'm working on the Desktop version 10.5 and actually the code is this one: def getParameterInfo(...
1
vote
2answers
463 views

Python toolbox documentation from within pyt file

Python toolboxes are a great way to create custom, GUI toolboxes for ArcGIS without actually interacting with the GUI (since everything can be defined within the pyt file). Regrettably (and ...
1
vote
1answer
80 views

Manually modifying ArcGIS Server Geoprocessing Parameters Data Type?

In ArcGIS 10.5, when I publish a Python Toolbox result as service, the parameters such as GPRasterDataLayer become GPString if these parameters are unfilled when running the toolbox on Desktop. This ...
1
vote
0answers
63 views

ArcPy Script Tool multi-value re-order buttons

I'm trying to set the values of one control (Multi-value, data type: string ) to another parameter control (Multi-value, data type: "any value" which produces a drop down with grid for items entered ...
0
votes
1answer
208 views

MultiValue Selection with MultiValue Input

I made this Python Toolbox as a practice run for a larger project I want to do as I am new to python toolboxes. While this was successful I am not able to the result that I want. I want to be able to ...
1
vote
1answer
50 views

Creating tfb file in Python Toolbox?

What tool does: Simply creates tbf file from raster extent. What is the problem: I ran toolbox in ArcMap 10.5.1 and ArcGIS Pro 2.2.4. When I run it as standalone script it is working just fine. I ...
0
votes
1answer
74 views

Checking for raster coverage within polygon feature class using ArcPy?

I'm writing a Python toolbox and would like to build in a check for raster data within the user-supplied area of interest. This piece of code works most of the time: if (str(arcpy....
1
vote
1answer
106 views

Encoding in Python toolbox?

My Python toolbox uses a function (code below) to save values to a CSV file. When I was using the same code in a Jupyter notebook, saved records were properly encoded (I am dealing with Polish letters ...
0
votes
1answer
52 views

Using Python map function with ArcPy?

Script is simple made for this case. Creating new shapes based on known arguments. My code: import arcpy #variables fc_1 = 'fc_1' fc_2 = 'fc_2' fc_3 = 'fc_3' fc_4 = 'fc_4' war_1 = "highway = 'path'...
1
vote
1answer
35 views

How to Load an Input of MultiValue Parameter Based on First Input Select

I am trying to create a Python Toolbox and I need to load some chekboxes to a parameter (param2) after selecting a value in previous parameter (param1). As you can see I have name of states in param1 ...
1
vote
1answer
207 views

GPSQLExpression - python toolbox

I am relatively new to python and I am trying to build a tool within python toolbox with GPSQLExpression as parameter. I am having trouble with populating its field and value list. Below is part of ...
3
votes
1answer
38 views

Licensing Issues while writing Community Project using ArcPy?

I'm creating a project for the Esri community, that uses some Basic ArcMap license, to create tools that require an Advanced (ArcInfo) license. Is there a licensing issue to do something like this? ...
1
vote
1answer
79 views

Python Toolbox keep xml meta data formatted for version control

Is there a way to keep Python Toolboxes metadata formatted nicely for version control? I use git to maintain my Python Toolboxes and when I make edits to the toolbox the metadata is updated and put ...
1
vote
1answer
68 views

Python toolbox xml SyncOnce tag meaning

What does the SyncOnce tag mean? I have a Python toolbox and this xml document was created. toolbox.tool.pyt.xml <?xml version="1.0" encoding="UTF-8"?> <metadata xml:lang="en"> <...
0
votes
1answer
149 views

Removing layer from TOC when it has space in name using ArcPy?

I am trying to remove layers from the TOC using Python Toolbox. It works provided that the layer names have no spaces in their names. Tho whole script looks like: class ...
0
votes
1answer
177 views

Setting GPFeatureLayer parameter programmatically in Python Toolbox (.pyt)?

I've created a python toolbox (.pyt file) with 2 tools in it: Prep() creates various derived datasets; Track() does processing using the prepped data. The idea is for Prep to be run just once, ...
1
vote
0answers
92 views

Retrieve subtypes from feature service using arcpy

Within a python toolbox, I'm trying to retrieve subtypes from a feature layer in ArcGIS Pro using arcpy.da.ListSubtypes(). The feature layer is a hosted feature service on ArcGIS Online. Rather then ...

1
2 3 4 5 6