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

RuntimeError: Cannot acquire a lock. while using InsertCursor & Edit Session

I wrote a Python toolbox that inserts some rows to the table and it generates some specific values. It runs on some gdbs but I get an error on saying cannot acquire a lock on some other gdbs. Here is ...
user avatar
0 votes
0 answers
22 views

Multiple functions linked to parameter in ArcPy Python Toolbox

I would like to link some parameters directly to its function, so when i call a .map() function it could apply for several images in the collection. def __init__(self): """...
user avatar
0 votes
1 answer
47 views

Trying to Call a List From a Function within one Class to Another Class

I have an Python Toolbox script that contains two classes/tools. I want it so that the user inputs the data into the first class and then the second class will handle the processing. How can I write ...
user avatar
2 votes
1 answer
76 views

ArcGIS Python Toolbox - Reordering parameters and reference by name instead of index

Is there a way to reference parameters in an ArcGIS Pro Python Toolbox by name, instead of by numeric index / positional argument? I built a data entry tool in a Python Toolbox that has over 100 ...
user avatar
  • 93
0 votes
0 answers
26 views

GP Service does not update next dropdown list based on previous entry [duplicate]

I have created a tool that takes a numeric value as an input and it creates that many lists according to the first value. It works in ArcGIS Pro desktop however it does not work in WebAPP GP service. ...
user avatar
0 votes
1 answer
93 views

Implementing FieldMapping parameter in ArcGIS Pro Python Toolbox tool to map fields in two tables

I am trying to create a tool within a Python Toolbox in ArcGIS Pro that will accept a table and a featureclass and allow a user to map the fields from the feature class to fields in the table. ...
user avatar
0 votes
0 answers
59 views

Difference plugin vs processing QGIS script GUI

I would like to know if there is a way to build a processing provider script having the same abilities as in plugins under 'tool button with dialog' & 'tool button with dock widget' considering ...
user avatar
  • 167
1 vote
1 answer
53 views

Restricting one parameter value list against another's chosen value in Python Toolbox using ArcPy with ArcGIS Pro

I have a script loaded as a toolbox into ArcGIS Pro. It has two multi-value string parameters. Is there a way to restrict the second parameter's list against the first? For example, if a user picks &...
user avatar
0 votes
1 answer
94 views

Reading local file from Geoprocessing Service on ArcGIS Server

I have a Python toolbox which I would like to publish to our ArcGIS Enterprise 10.8.1 environment. I use ArcGIS Pro 2.7.3 for publishing. The Python toolbox reads from a configuration file on the file ...
user avatar
  • 1,261
0 votes
0 answers
40 views

Failed to create Python toolbox from .pyt file in ArcGIS Pro 2.7.3 - WATTE.pyt [closed]

I want to import an Python toolbox from a .pyt file into ArcGIS Pro 2.7.3 The .pyt file is intended for ArcGIS Desktop, but I corrected Python 2 to 3 errors and ran the "Analyze tools for Pro&...
user avatar
0 votes
1 answer
71 views

Accessing built in coordinate systems from ArcGIS Pro Python Toolbox tool

I am attempting to create a custom ArcGIS Pro Python Toolbox tool and some of the geoprocessing tools I use run slowly or not at all if the input DEM or environment is not projected first. I would ...
user avatar
  • 3
1 vote
1 answer
57 views

How can I evaluate the environment level within a Python toolbox

According to Esri: There are four levels of environment settings: application, tool, model, and model process. https://pro.arcgis.com/en/pro-app/latest/tool-reference/environment-settings/what-is-a-...
user avatar
  • 1,261
3 votes
1 answer
94 views

How to suppresss Python Toolbox from adding output datasets to the map

I wrote a Python Toolbox and would like to suppress it from adding output datasets to the active map. Below a minimal example (not the actual toolbox): import arcpy from typing import List class ...
user avatar
  • 1,261
0 votes
1 answer
79 views

Does Web AppBuilder GP Widget handle validation from Python Toolbox published as GP Service?

I have created a python toolbox in ArcGIS Pro that I want to share as a GP Service. The user inputs their Portal URL, username, password and the GIS Server parameter dynamically provides a dropdown ...
user avatar
0 votes
0 answers
59 views

Setting a .sde connection file as a default value in an ArcPy toolbox

I am building a tool to run some routine data maintenance on an Enterprise geodatabase with Python. I would like to set the default value for one of the parameters to database connection file on disk. ...
user avatar
4 votes
2 answers
143 views

Using Python Toolbox Parameters

I want to specify an input for each column of the 'field compare' parameter, so it would be 'baseFeatures' would link just to the 'Base Fields' column and 'updatedFeatures' would just link to the '...
user avatar
  • 41
0 votes
0 answers
32 views

Unable to export results by using Python Toolbox Tool

I have this sample code below that I use to access to a REST API service and get results. import arcpy import os class Toolbox(object): def __init__(self): """Define the ...
user avatar
0 votes
1 answer
35 views

Toolbox For ArcGIS Desktop 10.5 not working for all values

I'm trying to build a toolbox, and I would like users to be able to select two possible values from two lists. The first list is stored in a JSON, that I access using HTML. The second list is also a ...
user avatar
1 vote
0 answers
73 views

Autocomplete for input parameters in a Python toolbox for ArcMap (or ArcGIS Pro)

Is there a way to get word completion to work for string parameter inputs in a Python toolbox? We are working with very long value lists (a few thousand entries per list) and scrolling the drop-down ...
user avatar
  • 11
1 vote
1 answer
97 views

Getting simple ArcGIS Python toolbox parameters to be enabled or disabled on load

I am attempting to get a simple ArcGIS Python toolbox (pyt) set up that allows me to present a subset of appropriate parameters based on selection from a 'parent' parameter. There are 7 (0-6) total ...
user avatar
  • 1,325
1 vote
0 answers
23 views

Could not make join work in toolbox but works in Jupyter notebook

I am selecting points from the map and roads and trying to join them based on my picks. It works in Jupyter notebook however it does not work in toolbox and I could not figure it out. I tried to ...
user avatar
3 votes
1 answer
69 views

Getting new parameter after Python Toolbox gets executed

I am trying to build a toolbox which would first take some inputs and execute some code and return me results. After the results I would like toolbox to ask me for new parameters so I can use these ...
user avatar
2 votes
2 answers
304 views

Grouping Parameters in Python Toolbox of ArcGIS Pro

I am making a Python Toolbox for ArcGIS Pro. The main tool in the toolbox needs to have 5 radio buttons: Users can select any number of options (from 0 to 5). Is it possible to group or cluster the ...
user avatar
  • 1,033
-3 votes
1 answer
49 views

Data Type that can be used to select Desktop as a folder in ArcGIS Python Toolbox (ArcGIS Desktop: ArcMap 10.6)

I have created a Python Toolbox. While setting up my tool, in the parameters I am trying to find a data type to use in order to select Desktop as the location to create a folder. I need to find a ...
user avatar
1 vote
0 answers
147 views

UpdateCursor cannot acquire lock if attribute table is opened in ArcGIS Pro

I wrote a script tool for someone to allow them to clean all whitespace errors (leading/trailing spaces, 2+ consecutive white spaces, convert empty strings to nulls), and aside from one issue it works ...
user avatar
  • 565
3 votes
1 answer
121 views

Python Toolbox with Many AddField() Calls Runs Slower With Attribute Window Open

I recently finished developing a Python toolbox tool that ends up calling the arcpy.AddField_management() function about 25 times or so. I first developed it as a standalone script to get it working ...
user avatar
  • 538
0 votes
1 answer
107 views

ArcPy - Get Date as parameter value and calculate Date field

In my ArcPy script I have an input parameter for the Date, so the user is asked to input a date value (time is not needed) using the data type GPDate. In the script I calculate a new field, field data ...
user avatar
2 votes
1 answer
187 views

Generating multiple page reports (Page Per Report) using ArcGIS Pro & Python

I have reached a point a little bit outside of my knowledge frame. Python. I found that I can create multiple page reports with Python in ArcGIS Pro by combine 2 reports together. I am following this ...
user avatar
2 votes
0 answers
33 views

Layer no longer renders on map after running custom Python Tool

Please note: I believe this is a display issue, since the data isn't disappearing from anywhere but the lines on the map. When I run a custom Python Toolbox in ArcGIS Pro 2.7.0, the layer that was ...
user avatar
0 votes
1 answer
96 views

Creating a Toolbox in ArcGIS Pro that can export results into an image format [closed]

How can I create a Toolbox in ArcGIS Pro that can export results from point and line feature classes and combine them into just one image format (e.g. .jpg, .png). like so
user avatar
  • 1
0 votes
1 answer
78 views

JoinFeature attribute_relationship syntax (arcpy)

I am building a Python Toolbox for ArcGIS using Python 3 with ArcPy. I have two tables that I need to relate based upon an attribute. The information on the documentation for the JoinFeatures() ...
user avatar
2 votes
1 answer
21 views

Writing program to get datatypes of certain fields and then do some work on that but SearchCursor makes everything tuples

I am trying to write a program to get the datatypes of certain fields and then do some work on that but SearchCursor makes everything tuples. How do I bypass this situation and get the actual datatype ...
user avatar
2 votes
1 answer
244 views

How to access a "geoprocessing value object" when a row in ValueTable is empty (Python Toolbox)

I have a tool with a ValueTable consisting of two columns - text (GPString) and layer (GPFeatureLayer). When I fill the parameter with desired values (field names in the first column, some feature ...
user avatar
  • 431
1 vote
0 answers
23 views

Customizing ArcGIS toolbox layout [duplicate]

I am trying to create a customized tool in ArcGIS using Python Toolbox. Does anyone know how I can change the appearance (for example, size of a textbox or position of a parameter) of a parameter on ...
user avatar
1 vote
1 answer
90 views

ArcGIS Reclassify fails in Python Toolbox

I'm trying to build a Python Toolbox to analyze submarine landslides. Among other things I want to run the aspect tool and then reclassify the aspects into groups with a 45 degree interval. Therfore I ...
user avatar
  • 21
2 votes
1 answer
130 views

For loop for access to a directory files in ArcPy

I have a Python Toolbox and I want to use a directory to read different shapefiles. But when I run the script It only works for the first shape. fd is the directory and the code is: fd= parameters[0]....
user avatar
  • 301
2 votes
1 answer
565 views

Error: local variable referenced before assignment in ArcPy

I have a directory with contain others subdirectory with shapefiles. I access to the shapefiles using a for, but then when I ned to use the variable shape that I get this message: UnboundLocalError: ...
user avatar
  • 301
0 votes
0 answers
134 views

How to get ArcPy parameter of type Folder shown in Textbox?

Writing an ArcPy toolbox for ArcGIS Pro I am having the issue that the declaration of the following code does give me a browse button and the associated textbox. However, using the browse button, and ...
user avatar
2 votes
1 answer
354 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 ...
user avatar
  • 431
2 votes
1 answer
434 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 ...
user avatar
  • 121
1 vote
1 answer
40 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 ...
user avatar
  • 1,699
0 votes
1 answer
112 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....
user avatar
  • 1,699
0 votes
1 answer
311 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 ...
user avatar
  • 3
0 votes
2 answers
279 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 ...
user avatar
-1 votes
1 answer
82 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?
user avatar
1 vote
1 answer
185 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", ...
user avatar
1 vote
1 answer
531 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 (...
user avatar
0 votes
0 answers
93 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 ...
user avatar
  • 986
1 vote
1 answer
202 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 ...
user avatar
  • 986
3 votes
1 answer
103 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( ...
user avatar

1
2 3 4 5
7