Questions tagged [tool-validation]

Provides custom behaviour for Python script tools and Python toolboxes of ArcGIS for Desktop via ArcPy code

Filter by
Sorted by
Tagged with
0
votes
2answers
35 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
0answers
35 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
0answers
33 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
1answer
79 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
0answers
22 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 ...
0
votes
0answers
14 views

ArcToolbox, adding custom options to a dropdown list based on python list [duplicate]

I have created a simple ArcToolbox Script in python that the user can enter a domain code and description into the tool, and it is applied to a domain on our SDE. I want to make this tool more ...
1
vote
2answers
30 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
0answers
120 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
1answer
61 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
1answer
136 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
0answers
52 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
1answer
165 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
147 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
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 ...
3
votes
1answer
61 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 ...
2
votes
1answer
262 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
1answer
63 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 ...
1
vote
1answer
389 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
2answers
796 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
1answer
53 views

Performing operations on tool`s startup

I want to perform a selection on tool startup in order to obtain a choice list for parameter derived from selected features. Code kinda works, as I get my choice list with correct values, however it ...
2
votes
1answer
174 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
1answer
308 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
1answer
181 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
1answer
269 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
1answer
449 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
1answer
204 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
2answers
206 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
1answer
173 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
1answer
394 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
1answer
395 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
1answer
111 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
2answers
368 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
1answer
398 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 ...
1
vote
1answer
757 views

Creating multi-value choice list of field values and using selected for select in ArcPy?

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 code to my needs but now ...
1
vote
0answers
38 views

drop list from field to excute SQL request

i'm new to Python programming and now I try to create a python script that allows a selection attribute based on the name of a field in the attribute table of a layer and I would like to configure my ...
1
vote
0answers
50 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
1answer
93 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
1answer
45 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 ...
4
votes
3answers
1k views

python script tool validation checkboxes to radio boxes?

I am trying to build a tool in arcmap, which uses radio buttons in its gui. Since I read, that radio buttons are not supported, I figured, it couldn't be too hard changing the behaviour of simple ...
2
votes
0answers
63 views

Why does my Validation Script continue to run when adding the result to the map? [closed]

I am in the process of developing a python script that creates a list available imagery for our project areas that would then allow the user to choose which imagery source they would like to add to a ...
1
vote
0answers
328 views

How do you use the setErrorMessage(message:string) within the ToolValidator Class?

The Programming ToolValidor Class ArcGIS Help menu states that: the following method: setErrorMessage(message:string) "Marks the parameter as having an error (a red X) with the supplied message. Tools ...
2
votes
1answer
93 views

Searching for value in layer without opening MXD file?

As part of the validation for parameters of a Python toolbox, I need to check if the text in parameter #1 is exists in a layer in a MXD file selected as parameter #2. Currently, I use this code in ...
3
votes
1answer
1k views

Python toolbox - keep parameter value updated after re-altering parameters

I am writing a Python toolbox with (among other) 3 parameters: 2 boolean (check boxes) and 1 string. The string parameter's properties depends on the 2 booleans' value: If at least the first boolean ...
3
votes
0answers
581 views

Updating Field Mappings Parameter on table selection in Python Toolbox? [closed]

I am building a python toolbox with ArcPy and would like to associate an input feature class parameter with a field mapping. I want the input dialog to work as it does in many built-in geoprocessing ...
1
vote
1answer
282 views

ArcGIS 10 ToolValidator - Empty feature class and feature class within declared feature dataset

I'm new to ToolValidator for a script tool and I'd like to make two checks which then adds an error if either rule is violated. I need to make sure parameter 2 and 3 (feature classes) are within ...
1
vote
1answer
557 views

ArcGIS python script validation to update text based on list?

I'm having issue with using validation to update an input box. Some background: I created a tool to update and resize text in ArcGIS. This is done by having a series of text elements and shape ...
1
vote
1answer
163 views

Problem with tool validation script in ArcGIS?

I have tried to write some validation code for a script in ArcGIS. This validation code more or less repeats what the script itself does, which is a simple cutting up of a long string by using the ...
3
votes
0answers
306 views

Custom error message with 'Error Code -1' in ArcGIS script tool [closed]

I have a script tool in ArcGIS 10.2 and I have altered the tool's validation code to show my custom error messages using setErrorMessage method. It works but when an error message is displayed it ...
1
vote
1answer
848 views

Using tool validation to create parameter based on fields of another parameters input?

I'm assuming I'm missing something and this is a pretty easy thing to do but I'm stumped... I'm working on a script that currently takes and input excel file and uses a "hard coded" field name that I ...
10
votes
1answer
3k views

Set default values for value table in Python Toolbox tool

I created a Python Toolbox tool to reorder fields and create a new feature class with the reordered fields. The tool works nicely and I am able to use a value table to let the user arrange the fields ...