Questions tagged [tool-validation]
Provides custom behaviour for Python script tools and Python toolboxes of ArcGIS for Desktop via ArcPy code
88
questions
0
votes
1
answer
55
views
Python Script Tool with validation not opening in ArcGIS Pro
I am trying to figure out why my ArcGIS Pro Python Script Tool with validation fails to open when I insert the block of code in my image.
def initializeParameters(self):
shpFile = r"C:\LPA\...
0
votes
0
answers
25
views
Reference dictionary keys in ArcGIS Tool Validation
I have a Python script that is stored in a custom toolbox in ArcGIS Pro. The script has a dictionary myDict that I want the keys of to appear as a drop-down list as an input for the tool.
I know how ...
1
vote
1
answer
190
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. ...
1
vote
1
answer
618
views
Selecting a value from the Python toolbox drop-down list of an ArcPy script in ArcGIS Pro
I created a script. I would like the user to be able to select a value from the drop-down list. Once the value is selected, I would like this value to be displayed on my cover page that I created.
...
1
vote
1
answer
132
views
Setting default extent parameters in Script Tool
I have an ArcMap Script Tool that calls the "extent" parameter. It contains a pulldown for how to obtain extents (Default, Union of inputs, Intersection of inputs, As specified below, and ...
0
votes
1
answer
62
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 ...
1
vote
1
answer
804
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 ...
0
votes
1
answer
169
views
Extracting the datasource of a feature layer selected in a tool parameter in the tool validation script in ArcGIS Pro
I have a tool with a 'Feature Layer' input parameter where the user can select a feature layer from the TOC or a feature class by browsing. I would like to create an error message where the user is ...
1
vote
1
answer
173
views
Adding message error box when parameters do not satisfy some conditions
I have 3 parameters in my tool, including para0, para1, para2. These parameters will be the user's inputs. I would like to display a message box if para0>para1 or para1>para2 or para2>para3.
...
2
votes
1
answer
56
views
Getting zmin zmax of a raster parameter in a tool validation in ArcGIS Desktop 10.7 toolbox Python script
I am developing a Python tool (my first one).
The tool has 3 input parameters:
a raster
z min
z max
I am trying to get automatically z min and z max after the user specify the raster using the ...
1
vote
2
answers
513
views
ArcGIS Pro Script Tool Validation Not Updating Values in Tool
I have an ArcGIS Pro toolbox tool based on a python script and am trying to have tool validation pre-fill values based on the location of the ArcGIS Toolbox location. Here is a screenshot of the tool:...
1
vote
1
answer
597
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
2
answers
287
views
ArcPy Tool Validator error with defined parameter value
I am using ArcMap 10.3.1.
I have two parameters for my script tool. The first is the type of product to be created, the second is the scale of the product. Digital Map / No scale required are the ...
0
votes
2
answers
66
views
How to Prevent Final (Unnecessary) Selection Box in Script Tool Input Parameters via Validation Script?
Using Arc 10.2.2.
My script tool's interface has its first parameter populated by the following snippet of validation script:
def initializeParameters(self):
# Source Folder
dir_f = r'Q:\...
1
vote
0
answers
51
views
Drop down for Unique Values for a ArcGIS Custom Tool [duplicate]
Can an ArcGIS Tool have a drop down field with unique values derived from a list? For example, user selects a table, the tool will then find all of the values in field X and populate a drop based on ...
0
votes
0
answers
68
views
Enabling a parameter in a field map in a Python script
I am creating a customized version of the Find Identical tool in Python. The script works just fine, but there's one thing that I can't seem to figure out.
In the standard ESRI Find Identical tool, ...
0
votes
1
answer
340
views
Create default ArcToolbox parameter with current folder location of ArcToolbox .tbx
I have an ArcToolbox tool I created based on a script I wrote that needs an input parameter that equals the folder location of the ArcToolbox .tbx file from which the tool runs. I am distributing the ...
1
vote
0
answers
36
views
Collapsing arcpy script parameter categories by default? [duplicate]
Within an arcpy script, I've set up categories using the style sheet found in the ArcGIS installation folder. I have a couple categories created within the tool validator.
....
def ...
1
vote
2
answers
38
views
Toggle field in custom Arcpy script
I've got a script wherein I'd like to toggle (gray out) certain fields, unless a file has been specified.
In the above image, I'd like Field A, B, and C to only be editable once a file has been ...
0
votes
0
answers
181
views
Why is Loop in Python Script Tool Validation only Looping Once?
My Python Script tool (ArcGIS Desktop 10.2) has two getParameterAsText inputs.
The first parameter is populated by the initializeParameters(self) module in the validation script which selects all ...
1
vote
1
answer
173
views
Forcing Python Script Tool Parameter Input Field to Begin at Specific Folder?
I'm setting up a Script Tool (Arc 10.2.2) where the first parameter will be a CSV file chosen by the user, always from the same folder.
When the user clicks the first parameter's windows navigator ...
2
votes
1
answer
607
views
ArcGIS Toolbox Python Script Validation: extracting field names from a multi-value list of feature classes
I am writing a python script within an ArcGIS toolbox (not a Python Toolbox), that takes as input, a multivalue parameter of feature classes from which I would like to populate a second parameter with ...
2
votes
0
answers
79
views
Updating Value in Toolbox using ArcPy? [closed]
I'm quite new in ArcPy.
I'm able to get a list of values from a Layer Feature and for specific field, however I would like to edit that attribute after is displayed on the screen. Because the value ...
0
votes
1
answer
353
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
1
answer
504
views
List layers in dataframe as parameters in script validation
I'm trying to do some script validation in a tool I wrote. The user first selects a dataframe from the current mxd. This parameter works fine. When the user makes this selection, the next parameter, a ...
0
votes
1
answer
288
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 ...
3
votes
1
answer
186
views
ArcGIS Tool Script Validation...browser window default location for multivalue option box
I am trying to do some Tool Validation for a script I'm writing in ArcGIS 10.2. I have a Multivalue File field which the user can browse to a directory to select the files they require to run. When ...
3
votes
1
answer
847
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
vote
1
answer
242
views
Validating user input against a range using tool validator in arcpy script?
I have a script that takes user input. For the "Project ID" input field, the user can only enter a 4 character ID. The ID may include letters and numbers, but is typically a 4-digit number. I'm trying ...
5
votes
1
answer
2k
views
How to only ask for a input if checkmark has been checked? (arcgis script tool)
I am currently working on a python script, that i want to convert to a tool.
I have managed to set it up in Arcgis as a tool, but it does not behave exactly as i want it to:
What i want it to do ...
1
vote
2
answers
2k
views
Creating drop down of derived fields from CSV using ArcPy?
I'm trying to create a drop down menu in a Python script in ArcMap where one input is a CSV and the other input is a drop down of the headers in that CSV. Is this possible at all?
In the image above,...
3
votes
1
answer
88
views
Performing operations on Python Script tool startup
I want to perform a selection on tool startup in order to obtain a choice list for parameter derived from selected features. Code kind of works, as I get my choice list with correct values, however it ...
2
votes
1
answer
403
views
Maintaining sorted unique values in value table of ArcGIS Pro Python script tool validation?
I have created a Python script tool in ArcGIS Pro 1.4.1 which has tool validation.
The fourth parameter on my tool dialog, which is of type string with multiple values allowed, after choosing some ...
1
vote
1
answer
650
views
Editing validation code for Python script tool in ArcGIS Pro using IDLE?
I created and successfully tested a Python script tool, for which I included some validation code, in ArcGIS Pro 1.3.1.
To write the validation code I right-clicked on the Python script tool in its ...
1
vote
1
answer
408
views
Using OS module in the updateParameters of Python Toolbox
I want to set the default value of one parameter based on another one. The files might be moved between different locations, but their relative locations would be the same. For example, file A is at C:...
2
votes
1
answer
373
views
Select All in the Python script tool doesn't work
When I click on the Select All, it doesn't work (using ArcGIS 10.3.1 Advanced). How can I fix this?
The Python Script for this model is listed below, from the online source rather than my creation.
...
6
votes
1
answer
598
views
Non-existent polygon inside polgyon
I inherited some shapefiles that I've been trying to clean up in QGIS and Grass. The shapefile is a large area covering a watershed, the person who digitized it, did so in small chunks without using ...
2
votes
1
answer
471
views
Deriving input based on other parameters in Python script tool?
I have a folder and it contains two feature classes, e.g., a.shp and b.shp. The script tool created has two parameters. The first one is the model location, and the second one needs a feature class (a....
2
votes
2
answers
399
views
Problem getting value from arcpy script tool with validation code driven drop-down: code window popup on tool execution
I am attempting to provide the user a drop down list of field values based on a predefined shapefile or table. The string value users choose then needs to be taken by the script tool for use later in ...
3
votes
1
answer
484
views
Controlling Categories in Script Validation Tools - Expanding Groups By Default
The validation tab in your script tool properties allows you to put parameters in categories. The help states:
Put parameters in different categories. Categories are expandable
window shades with ...
1
vote
1
answer
745
views
Setting default value for Python script tool properties using ArcPy?
I have a model folder which contains several shapefile, but only one named oil.shp. Is there a way to automatically set the default value for the Add Oil Layer based on the model folder and the ...
1
vote
1
answer
635
views
How to load data in a record set from a table?
I'm developing a python tool in ArcGIS 10.3 .I want to show selected record that are result of the select by attribute.
Is it possible to show the selected records in the record set ?
import arcpy
...
2
votes
1
answer
301
views
Setting Python script tool parameter Type based on another parameter Value? [closed]
In my script tool case, I've used the validation tool to make parameter[4] enabled only if parameter[3] equal a certain value, but i need to make this parameter[4] required only if enabled. the ...
1
vote
2
answers
956
views
Creating a drop-down list for arcpy script tool
I have written the following script but I cannot manage to create the drop-down list for the variable "select" (select=arcpy.GetParameterAsText(3)).
Any suggestions?
# Script arguments
inputRaster = ...
0
votes
1
answer
635
views
Filtering parameters in ArcPy Python script tool avoid repeating selecting same value in sequence parameters?
I am trying to make a tool in which there are many sequence parameters (based on the same field of a feature class), and each of them is multi value to make a user choose from a check a list one or ...
2
votes
1
answer
1k
views
Creating multi-value choice list of field values and using selected for select in ArcPy?
I am using ArcMap 10.3.
I have created a multi-value choice list following this blogpost:
https://blogs.esri.com/esri/arcgis/2012/07/16/generating-a-multivalue-choice-list/
I changed the validation ...
3
votes
1
answer
79
views
drop list from field to execute SQL request
I'm trying to create a python script that allows a selection attribute based on the name of a field in the attribute table of a layer.
I would like to configure my script such a way that permits the ...
1
vote
0
answers
75
views
Feature Layer parameter showing only Polygon Shapefiles
I have created a Python Tool in ArcGIS where most of the paramaters musts be ONLY Polygon Shapefiles. You can also look on my previous question:
Filter the Feature Layer parameter in Python Script ...
1
vote
1
answer
122
views
arcpy custom script tool to find and replace floats and ints?
I created a custom script tool that can find and replace text. See the image link for what my tool interface looks like too, and I'll point out the find and replace fields are both set to string in ...
1
vote
1
answer
73
views
Tool validation to filter out OID and geometry fields?
I have a python script tool (arcpy) in a standard toolbox that edits data in fields, but I want some code in tool validation that would make sure that when the user gets to the field parameter, the ...