Skip to main content

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
-1 votes
1 answer
56 views

Returning value from ArcGIS Pro custom tool (.py)

How do we return a value from a custom .py tool, so that when I run the tool in another script, it will return a value (such as a number, string, or tuple)? Notice in the execute class function, I ...
Clouseau's user avatar
0 votes
0 answers
35 views

Running all custom tools in separate tool script in ArcPy

I created a toolbox with a bunch of scripts for ArcGIS Pro. I created a separate tool, RunAll, that runs all the tools within that toolbox. It runs at a good speed when I just run it as a python ...
Clouseau's user avatar
3 votes
0 answers
25 views

Setting valid input types in Python Toolbox

When adding a python script tool to ArcToolbox, you can specify valid input types using the dropdown "Data Types" on the parameters tab in the tool properties. In Python Toolboxes you can ...
Midavalo's user avatar
  • 29.8k
2 votes
1 answer
125 views

Running Python Toolbox in Background

I would like my Python Toolbox to be processed in the background. On this ESRI Technical Support Page, it states "Since ArcGIS Pro is itself a 64-bit application, a separate process for ...
ENIAC-6's user avatar
  • 906
1 vote
0 answers
57 views

Python toolbox in ArcGIS Pro for buffer distance

I am currently to make a Python toolbox in ArcGIS Pro to search and count for tourist attraction/activities that I can decide at some distance to at least two infrastructure facilities, and also using ...
Mathias's user avatar
  • 11
0 votes
0 answers
41 views

Why is first output of ArcPy tool only one running?

I am attempting to write a python tool that uses the create routes, locate features along routes, and make route event layer tools (in that order). Essentially this is a three step process that I want ...
Wes's user avatar
  • 11
1 vote
1 answer
52 views

Setting up parameters for linear referencing tools in ArcPy

I am attempting to write a python script to utilize the Create routes, Locate features along route, and Make route event layer tools from the Linear Referencing tool box. The ultimate goal is to write ...
Wes's user avatar
  • 11
1 vote
0 answers
68 views

Values in second columns of GPValueTable Parameter reset after tool is ran

I am trying to create a .pyt python toolbox tool in ArcGIS pro and the issue I'm running into is that Values in second columns of GPValueTable Parameter reset after tool is ran. The parameter created ...
Live Strong's user avatar
1 vote
1 answer
87 views

Importing CSV file in ArcGIS Pro ArcPy script using relative paths

I have a CSV file in my toolbox folder. I would like to import the CSV file into my arcpy script to run in conjunction with my arcpy script. Folder structure: src data my_csv.csv mytoolbox.pyt ...
Clouseau's user avatar
0 votes
1 answer
44 views

Create a new GPFeatureLayer from data frame

I am a complete newbie to ArcGIS/ArcPy. I am creating a new Python Toolbox, that reads in a GPFeatureLayer, and also should return one. I read in the values of a GPFeatureLayer row by row. Then I ...
WilliWespe's user avatar
0 votes
1 answer
102 views

Python Toolbox - Parameters drop down list will not update with new parameter

I am making a python toolbox for ArcGIS Pro 2.9.8 with arcpy in Python 3.7 I have a workspace parameter defined as param1 = arcpy.Parameter( displayName="Feature Dataset or Geodatabase ...
MrKingsley's user avatar
  • 1,443
1 vote
0 answers
38 views

ArcMap PYT toolbox open so slow every time starting new .mxd

I am using ArcMap 10.8. If I put this class (code below) in a empty PYT toolbox, it will take more than 10 seconds to open, everytime starting a new mxd. So far I find the reason is the default value ...
alan's user avatar
  • 21
3 votes
2 answers
240 views

Closing single map view in ArcGIS Pro using ArcPy

Using ArcPy for ArcGIS Pro 3.1, is it possible to close a particular map view if it is open but not any other open map views in an ArcGIS Pro project? Currently my tool uses "aprx.closeViews(&...
eclecticlearner's user avatar
0 votes
1 answer
175 views

Which parameter data types in a Python toolbox for selecting a path

I need to select a SDE PATH based on user selection on Python toolbox at ArcGIS Pro 2.7.1 and use this path at the code for setting like fc = 'Zone' SDEDir = inputPath arcpy.management.CalculateField(...
user1106951's user avatar
  • 1,498
3 votes
1 answer
123 views

ArcPy toolbox - How to limit GPFeatureRecordSetLayer to interactive rectangle input

The issue I have an ArcGIS Python Toolbox for which I would like the user to be able to interactively define an oriented rectangular extent (bounding box + rotation) as input parameter. I currently ...
seb007's user avatar
  • 255
2 votes
0 answers
78 views

Developing a Python toolbox for multi decision criteria analysis

I am trying to get my hands dirty with Python toolboxes (.pyt) for ArcGIS Pro. I've learned a lot about how to configure the parameters for the ArcGIS Pro GUI, but my lack of SQL knowledge is really ...
fiendskrah's user avatar
0 votes
0 answers
90 views

Search Cursor toolbox Error 000601 (Python)

I'm trying to create a toolbox that utilizes a SearchCursor (with ArcGis Pro) to filter a layer with another's attributes. This is my first attempt and I've ran into some errors I don't know how to ...
Davec433's user avatar
0 votes
2 answers
98 views

Python Toolbox can't match input parameter to dictionary key in dictionary.get() function

I am writing a Python Toolbox for a parcel prioritization tool. My input data (a set of 11 rasters) is organized into a dictionary, raster_dict, where keys are raster names (i.e. 'Important Bird Areas'...
Tory Elmore's user avatar
1 vote
1 answer
501 views

ArcGIS Pro - ArcPy script exports PDF fine via Python window, but omits a layer when used as a Python Toolbox

I'm getting strange behavior from ArcGIS Pro 2.9.4 / ArcPy 2.9. In a nutshell, I have an ArcPy script that exports PDF maps correctly if I run it in Python Window, but omits one specific layer when ...
user3307180's user avatar
4 votes
2 answers
355 views

Python script in toolbox

I have a python script that clean my symbology for the selected layer, from here: from qgis.core import * from qgis.gui import * from qgis.utils import iface layer = iface.activeLayer() # get the ...
katagena's user avatar
  • 1,668
1 vote
1 answer
553 views

Calling table frame layout element from Python Toolbox using ArcPy

I created a Python Toolbox which calculates statisitics about some layers and print a pdf layout. The layout and table frame elements already exist. I try to access the table frame elements from my ...
Juliette Lapeyre's user avatar
1 vote
1 answer
168 views

Arcpy.CreateTable_management in Python toolbox not creating table in memory

The following creates a table in memory as expected when executed in the Python window [ArcGIS Pro 2.9, Windows 10]: arcpy.CreateTable_management('memory','dataTable') When I try to do the same thing ...
cmagagnosc's user avatar
0 votes
1 answer
116 views

Arcpy.CreateTable_management fails in Python toolbox (.pyt)

I am trying to create a table within a Python toolbox (.pyt). This works with file GDB's, but I would like to use a memory dataset if possible. A table can be created in memory manually or by calling ...
cmagagnosc's user avatar
2 votes
1 answer
472 views

Set user input as path for saving Python toolbox results

I created a Python toolbox to run in ArcGIS Pro 3.0. I wish to save toolbox results in another geodatabase than the one by default, which contains input data. This toolbox will be run by several users ...
Juliette Lapeyre's user avatar
2 votes
1 answer
811 views

Using multiValue parameter with ArcPy and ArcGIS Pro

I am using ArcGIS Pro. I want to make a Python toolbox tool (*.pyt) where I put for input multiple layer's and to apply a buffer for every input. I want every buffer to put another distance. After I ...
Octav's user avatar
  • 29
1 vote
1 answer
245 views

Python Toolbox updateMessages - Remember message from an earlier validation?

Is there a way to retain Warning or Error messages for parameters between tool validation calls? In my example below, I want to check the input feature class for something, and add a warning message. ...
Brennan's user avatar
  • 648
0 votes
1 answer
1k 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 ...
Mdebella's user avatar
3 votes
1 answer
203 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 ...
Brennan's user avatar
  • 648
0 votes
1 answer
630 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. ...
W. Kessler's user avatar
1 vote
1 answer
209 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 &...
JackOfTales's user avatar
1 vote
1 answer
710 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 ...
Thomas's user avatar
  • 1,745
1 vote
1 answer
315 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 ...
ffirgd's user avatar
  • 23
1 vote
1 answer
107 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-...
Thomas's user avatar
  • 1,745
3 votes
1 answer
701 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 ...
Thomas's user avatar
  • 1,745
0 votes
1 answer
275 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 ...
tigerwoulds's user avatar
0 votes
0 answers
268 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. ...
RicardoH's user avatar
4 votes
2 answers
727 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 '...
P-Rosa's user avatar
  • 41
0 votes
1 answer
67 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 ...
Karol Duarte's user avatar
1 vote
1 answer
377 views

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

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 ...
Zeygon's user avatar
  • 19
1 vote
1 answer
1k 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 ...
auslander's user avatar
  • 1,567
1 vote
0 answers
57 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 ...
Fatih Enes's user avatar
3 votes
1 answer
203 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 ...
Fatih Enes's user avatar
2 votes
2 answers
1k 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 ...
Keggering's user avatar
  • 1,121
-3 votes
1 answer
71 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 ...
Ayayayayaoh's user avatar
2 votes
0 answers
814 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 ...
John's user avatar
  • 607
3 votes
1 answer
351 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 ...
JustInTheWoods's user avatar
1 vote
1 answer
534 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 ...
GIS_USAr's user avatar
2 votes
1 answer
579 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 ...
KgEcology's user avatar
2 votes
0 answers
133 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 ...
Sharpie171's user avatar
0 votes
1 answer
279 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
cinnn's user avatar
  • 1

1
2 3 4 5
7