Questions tagged [python-script-tool]

Python Script Tools are added to standard toolboxes (*.tbx) of ArcGIS for Desktop

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Edit the default 'Extract Values' ArcGIS script tool input parameter display name?

Is there a way to change the default display name of the 'Extract Values' ArcGIS script tool input parameter? I would like to change the 'Raster' display name and the 'Output field name' text to ...
0
votes
2answers
42 views

Definition queries in Python Toolbox tools

I'm trying to set a definition query within a Python Toolbox tool in ArcGIS Desktop. The code below works when I run it in the ArcGIS Python window, but does not perform the definition query or ...
1
vote
0answers
14 views

ImportError: DLL load failed when running a script tool in ArcGIS Pro

I created a multiprocessing script that runs perfectly when running in an IDE (Spyder) but is giving me errors when running through the script tool in ArcGIS Pro. Here is the traceback: Running ...
2
votes
1answer
58 views

Checking Points within polygon and assigning value using ArcPy

How can I write arcpy code to determine if the points of a point feature class are inside polygons of a polygon feature class and write the result (true/false) to the point FC's attribute field? I ...
0
votes
0answers
40 views

ArcGIS pro Runtime Error: Cannot open shape file through Python Add-In

I am facing runtime error while running this Python script as an extension to ArcGIS Pro version 2.522081 I also checked for minor errors and typos in the script, have gone through the documentation ...
1
vote
0answers
22 views

How to use Boolean input in Arcgis with arpy? (Desktop edition) [duplicate]

So, my code goes something like this: haveopenvel = arcpy.GetParameterAsText(10) arcpy.AddMessage(haveopenvel) if (haveopenvel == True):#error openvelftsec = Raster(openvelftsec) arcpy....
1
vote
2answers
52 views

Using a Search Cursor to calculate a new field

I am new to ArcPy. What I am essentially trying to do is use ArcPy to look through a column in a table and if it is between a range to print a value in a new corresponding column. I assume I am going ...
0
votes
0answers
28 views

Create output folder for merge result of Model Builder on QGIS 3.10

I have export my model builder to python's script and now i would like to save the result to an created folder. But the folder name is based on a layer entity. Example: I have 3 layers (city, store, ...
1
vote
0answers
26 views

Problem creating a simple two-branch if-then-else logic (script tool) in ArcToolbox

I'm new to Arcpy and script writing and i'm trying to create a two-branch if-then-else logic based on the shapefile type of the input data. What I want to do is to write a script tool that executes ...
-1
votes
1answer
60 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:...
0
votes
0answers
21 views

Export Features by Unique Value Tool

I'm a new python user trying to build a script tool for an ArcPro project. The Tool will allow a user to select specific field data from a feature class and then export it as a new feature class to a ...
0
votes
0answers
31 views

ArcGIS Python script tool empty output

I have a script exported from ModelBuilder for a tool that import CAD file to geodatabase. When I run the code in a Python window in ArcMap it works just fine, and when I do using the model as well. ...
2
votes
0answers
48 views

Why do I get value of GDAL GetMaximum() different than that of numpy array max() for same image band?

Here is a code snippet from osgeo import gdal import numpy file = gdal.Open('DEMO.TIF') band = file.GetRasterBand(1) max = band.GetMaximum() if not min or not max: (min,max) = band....
0
votes
0answers
11 views

Automate Export Features from changed Layer

I'm using QGIS 3.10.2 A Coruna. I'm working on a project where I have a layer with different categories. I export each category on a regular basis (to shp and GeoJSON files) because others in my ...
1
vote
1answer
31 views

Split features script returning Python ERROR 000840: The value is not a Feature Layer

I am trying to split a feature layer by rows. I've previously some time ago been able to use the below script, however now when I use it, it returns: Python ERROR 000840: The value is not a Feature ...
0
votes
0answers
55 views

Extract related tables of a feature class to excel?

I have a feature class and a bunch of table connected to each other with relationships (please see the scheme of them down below). My goal is to extract the attribute table of fc as well as all ...
0
votes
0answers
26 views

Allow null values from Value Table filter list in Python toolbox parameter

I'm setting up parameters in a Python Toolbox and have a Value Table with three columns. Two of the columns have value lists for the user to pick from. I would like for the user to be able to choose ...
0
votes
1answer
27 views

Using Select Layer By Attribute in Python Script Tool

I just want to try to use a Python script to select specific roads in my Layer called "Route_01_Shatin" and so I coded as below: arcpy.management.SelectLayerByAttribute('Route_01_Shatin', '...
2
votes
1answer
44 views

Giving user option to show report on screen or create text file using Python Script Tool of ArcPy

I have been working on this script tool in ArcGIS Pro. The following code is what I got so far to create a tool in ArcGIS Pro, connected to the script, that takes parameters from users (initially, the ...
0
votes
1answer
44 views

Using IF statement to create 2 different output files in Python Script tool of ArcPy

I have a model which needs to only produce 1 final report but is dependent on whether a variable is provided.So there are 2 different flows following on from that selection Something like this, a ...
0
votes
1answer
33 views

Multi choice parameter data type in ArcMap Toolbox

I'm a beginner ArcMap user. I created a toolbox in ArcMap/mytoolboxes which will run an specific Python script from my hard drive. In my python script I need user to choose between 2 options. I want ...
2
votes
1answer
140 views

Raster Calculator in Arcpy Script Tool

I am working on a script tool that will be run from a custom toolbox in ArcCatalog. I have written everything with the inputs hardcoded into it for testing. Works great running from IDLE. I had ...
0
votes
1answer
34 views

Choosing Field in Python Script Tool using ArcGIS Pro

I am writing a script to quickly split large FCs and make them shareable. So I need the tool needs to know what the FC name is and What the Field Name is to split the FC into manageable segments. To ...
0
votes
0answers
116 views

ValueError: could not convert string to float: 'x_degree'

I want to create a decimal degree (dd) field from degree minute seconds (DMS) as a script tool. The CSV looks like this. My code looks like this: import arcpy inTable = arcpy.GetParameterAsText(...
1
vote
1answer
51 views

ArcGIS Toolbox Tools visible in Pro, not in Desktop?

I created these tools in desktop years ago and they worked up until yesterday and then they just disappeared in desktop? I can see them in Pro, but not desktop? Any reasons as to why this happened? I ...
0
votes
1answer
101 views

Raster error 'TypeError: Can't multiply sequence by non-int of type 'float' when creating Arcmap script

I am writing an Arcpy script to use in ArcMap (ArcGIS 10.7.1) as a tool to interpolate existing soil points, and make a nutrient recommendation afterwards. However, I'm getting the TypeError: can't ...
0
votes
1answer
26 views

'Fields' variable does not show specified shapefile fields in Arcpy custom script

I'm creating a script in ArcMap (ArcGIS 10.7.1). I have created tool parameters to specify the workspace where the data is stored (Workspace), a shapefile displaying a boundary (Field boundary), a ...
1
vote
1answer
23 views

Defining one numeric variable by defining another string variable (via parameter selection)

I'm creating an ArcGIS tool that will allow users to figure out how much nitrogen that a field needs based on interpolated points (Kriging). I will have the following parameters: #numeric variables ...
1
vote
0answers
38 views

Error in ArcPy script building network

I am trying to use the network analysis toolset to build a route. I made the the tool in model builder initially and have tried to edit it to make it a script. When I try to build the network I get ...
0
votes
0answers
20 views

Getting arcpy.GetParameterAsText to provide drop-down list for ArcGIS users [duplicate]

I'm creating an ArcGIS tool that will interpolate (using kriging) nutrient levels from soil test data, and will calculate the total amount of fertilizer per field that a customer will need to buy. ...
1
vote
0answers
43 views

Can't run 3D Analyst extension in custom script tool

I have custom python script in which I use 3D Analyst function "Add surface information", it works fine when I run the script through ArcCatalog Python Console, but when I try to run the script as ...
0
votes
1answer
67 views

Converting feature set inputs into feature class or feature layer for Python Script tool

I want to accept feature set as input and convert it into feature layer or feature class so that I can use the input in select by location in the python script, as the select by location don't accept ...
0
votes
1answer
34 views

Iterating through geodatabase and assigning field value based on spatial location using ArcPy - Part 2

This currently loops through my dataset and calculates the installation ID field from my dataset with the installation code from my Bragg Area feature that are within the polygon of each row. It works ...
1
vote
1answer
37 views

Generating list of feature classes from .gdb file using ArcPy Idle script: Error thrown

I'm new to ArcPy and Python and have a very simple question. I'm trying to write a Python script in idle to extract the number of feature class files from a geodatabase. I can do it just fine in the ...
0
votes
0answers
29 views

Snapping value = 0 in Qgis

I am building pipes network, I need check connection between of pipes. I want to pipes must snap and tolerance has value = 0. Is there any tool to check and fix this things. I know Topology Checker ...
0
votes
1answer
263 views

Converting abbreviation street type names to full names using dictionary for Python script tool? [closed]

I have a data table with a column 'STREET_TYPE' which are street types (RD, LN, ST, AVE etc.). I want to make a custom tool in ArcMap's toolbox that will expand these abbreviations to their full names ...
1
vote
1answer
40 views

Python script tool with multivalue raster input not honouring raster path?

I am creating a custom Python script in ArcGIS that takes a rasters as a multivalue input and have run into a problem which I don't think is a duplicate (having scoured SE for many hours) My problem ...
1
vote
2answers
77 views

Using sys.exit(0) in an ArcMap Script Tool?

I'm using a ArcMap script tool to test if a facility is on a list. If it's not on the list, I want to print a statement and exit the script. The script works just fine as a standalone script but it ...
0
votes
1answer
35 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): ...
1
vote
1answer
53 views

Filter fields by expression arcpy

I have to trasform a script (which I didn't write myself) from QGIS to ArcMap. In the script a filter by expression is used. The function has the input inl (= the layer with the data that should be ...
0
votes
1answer
31 views

Making dropdown in ArcMap tool where each item links to spreadsheet?

The script below imports a spreadsheet into ArcMap and generates a shapefile. Currently, I can use the ArcMap tool that interfaces with the script to navigate to the spreadsheet I want to import. This ...
0
votes
1answer
62 views

Creating Select Then Zoom Tool using ArcPy? [duplicate]

I have been trying to create a tool to make a simple select then zoom to selected but I've been running into some issues. I've been using the code from this original posting (https://community.esri....
1
vote
1answer
113 views

Getting selected feature and changing attribute incrementally in PyQGIS?

I am using QGIS 3.4.x and i need change attribute value, by order selection, for example: I have 5 polygons, | Order of selection | Number | | Polygon 1............| set to 1...| | Polygon ...
1
vote
2answers
97 views

QGIS 3, How to stop script from running automatically

I have written a python script in the QGIS editor which works as expected when I launch it from there. import processing import os from PyQt5.QtWidgets import QFileDialog from qgis.core import ...
3
votes
1answer
88 views

Applying Definition Query for multiple features using ArcPy?

I'm trying to apply the following code to extract features that contain these letters 'MW' within the field called 'CODE' for multiple layers. But I'm getting a SyntaxError for line 5 (defintion query)...
0
votes
2answers
57 views

Automate Access to all Tools in a Dynamic Toolbox in ArcMap?

Is there any way to automatically open a toolbox in ArcMap either from a model, a Python script or a Python Add-In, or similar? Or to otherwise make all of the tools in a toolbox easy to access for ...
1
vote
0answers
61 views

Using ETGeoWizard functions in ArcPy?

I have ETGeo Wizard license and I would like to run the functions via ArcPy instead of running them in ArcMap. However, the functions works in ArcMap but not in a script. one of the example is ...
1
vote
1answer
82 views

Letting user draw AOI or draw points for tool input In ArcMap script tool?

I have a python script which uses a point file to do some spatial analysis. After opening the tool in arcmap, I would like the user to be able to just click points on the map to generate the data. I ...
1
vote
0answers
12 views

Open Script with ArcMap hyperlink on a new window

I am using a hyperlink to open my script, import def_measure def OpenLink ([weg_name] , [path], [Color_Frame] ): bag_path = [path] weg_id = [weg_name] color_id = [Color_Frame] ...
11
votes
1answer
157 views

Python Script Performance as an ArcGIS Tool Versus Stand-Alone

Has anyone studied the difference in running a Python script in ArcToolbox versus as a stand-alone script? I had to write a quick-and-dirty script to convert a set of RGB images to single band by ...

1
2 3 4 5
8