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
0answers
23 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
172 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
65 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
113 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
55 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
49 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
43 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
20 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
33 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
64 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
34 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
37 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
59 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
37 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
30 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
94 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
70 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
44 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
110 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
93 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
35 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
115 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
85 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
167 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
183 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
25 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
509 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
64 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
129 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
62 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
137 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
108 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
54 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
78 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
115 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 ...
0
votes
1answer
266 views

ArcGIS error with Python Toolbox that imports matplotlib?

Recently upgraded to 10.5 ArcGIS. Custom ArcPy Toolbox (pyt) shows the red-x error and will not load. Going to "Check Syntax.." results in this: File "[from custom ArcPy Tool .py file]"... ...
1
vote
2answers
86 views

Refreshing default parameter values in custom tool loaded by python-addin?

I've built a tool that will be used to populate required metadata in the attributes of a specific schema. This tool is in a python toolbox and called by a python addin button. The value entered for ...
1
vote
1answer
151 views

Create near table to show the distance to every feature chosen in arcgis toolbox

I'm scripting a toolbox in which the user chooses a feature containing multiple points to create a distance table from other selected features in the list. The following script for every loop ...
1
vote
1answer
130 views

Debugging Serious Application Error from Python Toolbox?

I have written a few custom Python Toolboxes that my office uses. One of my coworkers has an interesting issue that I cannot replicate on a different machine: When he runs the tool, ArcGIS ...
3
votes
1answer
56 views

Make Route Events Layer Not Drawing All Routes From Python Toolbox Tool?

I'm working on a python toolbox tool that creates offset points along a polyline via the arcpy.CreateRoutes_lr() tool and arcpy.MakeRouteEventLayer_lr(). The tool simplifies the process by ...
0
votes
1answer
164 views

Accessing composite data type parameter when validating parameters in Python Toolbox?

I have a simple tool with two parameters: a boolean (just to tick or untick it) a composite data (where I can choose an output location - either a folder or a feature dataset). I am unable to access ...
1
vote
1answer
166 views

Overriding updateParameters()-Values in Python toolbox

I'm just getting started with Python toolboxes in ArcGIS and I'm pretty new to Python in general. I've created a python toolbox which takes an raster input file derives some values based on the name ...
0
votes
1answer
98 views

ArcGIS Tools Script Validation…filter list from domain values

Anyone know if it's possible to build filter list from a set of coded domain values I have in a file geodatabase? I have a script that works taking values from a table and correctly building a filter ...
2
votes
1answer
260 views

Tool validation - setting error message

I am writing a tool within Python Toolbox that has two parameters: param0 = arcpy.Parameter( name="a", displayName="A", datatype="GPFeatureLayer", ...
-1
votes
1answer
90 views

Embedding multi tool in one Python toolbox

I have written my codes as seperate python toolboxes. Then i decided to merge them into one. anyway I can't figure out how. I wrote like this: class MuglaToolbox(object): def __init__(self): """...
3
votes
1answer
147 views

Adding Combobox to Python Toolbox tool dialog?

I am trying to create a Python Toolbox tool which is supposed to add two fields State and StateAbb to selected Shapefile from selected combobox. How I can add a Combobox which contains a list of US ...
1
vote
1answer
90 views

Adding custom messages in Python Toolbox of ArcPy?

I am working with another user, and our previous question was Formatting dependent parameters in Python Toolbox? We gave up on trying to auto populate the drop down and instead are having the user ...
0
votes
1answer
218 views

ArcGIS for Servers 10.5 Output Parameter not properly set

When publishing ArcGIS Python ToolBox, it still uses the Desktop Output folder. The code below is coming from the toolbox. class LandSimilarity(TargetingTool): def __init__(self): """...
1
vote
1answer
156 views

Formatting dependent parameters in Python Toolbox?

I am setting up my parameters for my tool in python toolbox. So far it looks like this: The user inputs a tif into the Input Raster. I want the Select Bands (optional) tab to be a drop down menu that ...