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
32 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 ...
1
vote
0answers
40 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
28 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 ...
1
vote
0answers
42 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
43 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 ...
3
votes
2answers
57 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 ...
1
vote
1answer
64 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
84 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 ...
1
vote
0answers
77 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
32 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
73 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
91 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
46 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
68 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
30 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
296 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
81 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
287 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 ...
0
votes
0answers
90 views

Why is Python toolbox receiving 'none' as a GPDataFile parameter?

I'm building a widget in a WAB template that sends a geotagged photo to a Python toolbox GP service to create a point with the coordinates and attach the photo. I send the request to upload: var ...
1
vote
1answer
66 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
54 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
0answers
23 views

Initiating Edit Session when opening Python Toolbox?

I initially posted a question regarding the use of the GpFeatureRecordSetLayer Parameter in a Python Toolbox I am creating. Original Question: Using GPFeatureRecordSetLayer in Python Toolbox for ...
0
votes
0answers
51 views

Selecting layer by attribute in Python Toolbox of ArcPy?

I have this code where te input parameters are a shapefile [param0] and a string list [param1]. The second parameter is a list because I want that user select it. class Tool(object): def __init__(...
0
votes
1answer
149 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
42 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
52 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
81 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
39 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
31 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
147 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
75 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
55 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
132 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
137 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
55 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 ...
0
votes
1answer
151 views

ArcPy tool in toolbox crashes ArcGIS Pro

been writing a toolbox to speed up my work and I've run into a strange issue. My start well tool works fine, but my add surveys tool does not and causes ArcGIS Pro 2.1 to crash. I'll post the code ...
0
votes
1answer
143 views

Capturing Encrypted String from ESRI Python Toolbox Parameter

I created an ESRI Python toolbox and setup one of the parameters of the toolbox as an encrypted string as the parameter is a location for the end user to enter a password. The problem I am ...
1
vote
1answer
247 views

Parameter Data Type to Accept Both GDB or Feature Dataset

I would like the parameters in my script to accept both gdb workspaces or feature datasets. I have tried both "DEWorkspace" and "DEFeatureDataset", but both of these accept either gdb or feature ...
0
votes
1answer
266 views

Using GPFeatureRecordSetLayer in Python Toolbox for ArcMap?

I have written a Python Toolbox for ArcMap, that allows a user to consume a Template Feature Layer to run through a series of processes. The user defines an Area of Interest (AOI) in the Tool and ...
0
votes
0answers
31 views

Apply symbology to layer using arcpy - emulating the “import symbology function”

I am using ArcMap 10.4. I am creating a Python Toolbox which runs through a series of calculations and geoprocessing tools. The Toolbox is an update of an old VBA script I ran in ArcMap 9.3, where it ...
1
vote
1answer
729 views

Custom Python Toolbox not importing when module in other folder?

I'm following this guide http://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/extending-geoprocessing-through-python-modules.htm I got it to work on arcmap 10.6 (desktop) when the toolbox ...
0
votes
1answer
83 views

Validating shape type of input feature layers in Python Toolbox of ArcPy?

How can I get in explorer folder window a layer in specify shape? For example allow: How can We look, explorer after click INPUT FEATURES, shows a layers only points type. How can I get validate ...
1
vote
1answer
154 views

Derive (default) value in ValueTable based on values in ValueTable of Python Toolbox using ArcPy?

I am writing a Python Toolbox which needs Shapefiles (or Featureclasses) as input and calculates an output for each of the input files. I would like to have the possibility to rename the files in ...
2
votes
1answer
81 views

Saving output layer using Python Toolbox?

Why when I try to save my layer in destination gdb (I pass path) does it save in default.gdb? def getParameterInfo(self): """Define parameter definitions""" param0 = arcpy.Parameter( ...
0
votes
1answer
195 views

Getting layer from multivalue input in python toolbox

param5 = arcpy.Parameter( name="C", displayName="C", direction="Input", datatype="DEFeatureClass", parameterType="Required", multiValue=True) ...
1
vote
1answer
132 views

Not getting output field from Python Toolbox?

I can't see output field in my simple tool def getParameterInfo(self): """Define parameter definitions""" param0 = arcpy.Parameter( name="Input Features", displayName="...
1
vote
1answer
63 views

CalculateField_management, python Toolbox

I am trying to fill a field and I am using arcpy's CalculateField_management function. I want to fill the new field with the name of the shapefile, so I am using arcpy.Describe. But when I run the ...
1
vote
1answer
115 views

Add and fill a field in Python Toolbox (pyt) in ArcMap

I am using python toolbox in ArcMap, and I want to add a new field in a shapefile and after that I want to fill this field with the name of the shapefile. I achieve to add a new field using arcpy....
0
votes
1answer
153 views

Python Toolbox Illegal List value

I updating one of the parameters in my ArcGIS Python toolbox with data from SQL Server, but am getting an illegal list value error. I have removed a lot of the 'special' characters, but am thinking ...