Questions tagged [python-script-tool]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
37 views

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

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
35 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
52 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
24 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
37 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
27 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 ...
1
vote
0answers
24 views

Layers being removed erroneously at Python script tool finish? [closed]

I've got two Python scripts as a tools in a standard toolbox, and when the tools finish they will sometimes remove a layer from the MXD. It is most likely to happen on the first run of the tool ...
0
votes
1answer
41 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
61 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
47 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
49 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
49 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
29 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
46 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
9 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
117 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 ...
0
votes
0answers
43 views

Sending parameters to ArcGIS script through web interface

I have written a simple script in ArcGIS environment and I want to run the script through a PHP program. At present, I am trying this within localhost. In my script, I have defined two parameters. My ...
0
votes
1answer
80 views

Creating file geodatabase and using it as variable to create file path?

It's been a while since I've done arcpy scripting so it feels kind of new again. I'm working a script that is asking for these 5 parameters: workspace = arcpy.GetParameterAsText(0) RouteLayer = ...
1
vote
1answer
32 views

Limiting feature class parameter to specific geodatabase?

I have a tool that will update the geometry of a feature class based on the geometry of another, using a common identifier. It works great but the way I have it set up, you have to first select the ...
0
votes
0answers
61 views

Script sometimes stuck at arcpy.SplitRaster_management

my problem is that my script sometimes stuck then it use arcpy.SplitRaster_management. import arcpy import os #nearly 700 rows of script fclist: [ ...] # some fc rasterlist = [...] # many raster ...
0
votes
1answer
57 views

ArcGIS 10.5 Python script integration to 'script/tool' not outputting data

In ArcGIS 10.5 I have a python script that works well in the python window, however, I am trying to integrate it in a tool, mainly to make use of the arcpy.GetParametersAsText() input feature for the ...
2
votes
2answers
75 views

Locking stand alone ArcGIS Tool?

I have written a number of standalone Tools for ArcMap. These tools are all .py files and are run outside of ArcMap. At the moment it has only been me running these tools, but I have been asked to ...
1
vote
0answers
28 views

Checking Shapefile type (Point, Line, Polygon) in ModelBuilder using python script?

I am creating a model and would like the input to branch off to different tools within the model based on the shapefile type (point, line, polygon). I haven't found a tool in ModelBuilder that will do ...
1
vote
1answer
43 views

Coding Python about raster calculation for create a toolbox

I want to create a tool box in ArcMap. I wrote this code: # Import system modules import arcpy, os,sys from arcpy import env from arcpy.sa import * # Set input raster InputRaster=arcpy....
0
votes
1answer
58 views

Asking user to select file in Python Script tool using parameter?

In a custom toolbox you can make a parameter and ask user for input where he can type something and used as arcpy.GetParameterAsText(0) in the script in the toolbox. This is good if you want to use ...
1
vote
1answer
34 views

Spatial Join Using Python /ArcGIS Addin assistant

I have a point shapefile that contains all my field collected data, lat/long and all the field data collected during the season. The one thing not imported was the name of the Lakes these points fell ...
0
votes
1answer
47 views

Storing feature layer content inside ArcPy script tool?

I’m developing a script tool using ArcPy. I am wondering if there any way to store layer contents in my script in an encoded way and programmatically create this layer instead of referencing external ...
1
vote
2answers
58 views

Python script tool to make intersection points not working?

A colleague made a ArcPy tool for me which worked last year, but now it wont complete. I don't know what's different except maybe I moved the tool or it's output to a new location. It say's it get ...
0
votes
1answer
51 views

Getting Python Script Error 000539?

I'm attempting to create a tool that gives me the next available manhole number in a particular system. The manhole numbering structure looks like 1124-060E and therefore is a string field. Since ...
0
votes
1answer
111 views

Getting working Python script to run from toolbox?

I'm creating a model, using ArcGIS ModelBuilder, and want to use SelectRandombyPercent from Randomly subsetting X% of selected features using ArcPy? to randomly select points from a feature class. ...
0
votes
1answer
63 views

Other users unable to use ArcGIS Python script tool in shared folder?

I created a new toolbox with a script tool that successfully works for me when I run it. I have it saved in a shared folder that my coworkers can access but when they try to run it, it doesn't work. ...
0
votes
2answers
37 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:\...
0
votes
1answer
72 views

Getting name of executing tool in ArcPy?

I created a script in a custom ToolBox and I defined a name (here ImportTopojis): This name is displayed when you execute the tool : I simply want to get this name because I want to use a single ...
0
votes
1answer
56 views

Attribute Totals for Rain Gauges [closed]

My goal is to create summary information to eventually present rain gauge totals attributes such as 1 day, 7 day, 10 day, 24 day and YTD totals. I was wondering how to go about this in ArcMap or ...
1
vote
2answers
189 views

CreateTable_management as part of a script tool fail

I am trying to create a table as part of a script tool, and it always fails with error 999999. The general idea of the script is that it is calculating proportional coverage of things in a series of ...
0
votes
1answer
187 views

Python script parameters for Integer not working

I am using a Python library called arcpy_metadata that uses 2 datatype called max_scale and min_scale that take integers: My code for that is just: import arcpy, arcpy_metadata as md .... min_scale ...
0
votes
1answer
69 views

Output shapefile data type in Arcpy

I have to reproject a shapefile's coordinate system. To do that I am using Arcpy and I want to get an output to use it as input in other tool (in Model Builder). Now I get an output, but I cannot use ...
0
votes
1answer
266 views

Can't import custom Toolbox in ArcPy?

I have a custom made Toolbox and I can't make it run. The Toolbox is called toolbox_k and the tool is called sn I did this: arcpy.ImportToolbox(r"C:\Users\user\Desktop\VST\Toolbox_k.tbx", "sn") I ...
1
vote
0answers
36 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
1answer
46 views

What does the prefix GP or DE on parameter data types in a Python toolbox mean?

What does GP and DE mean as seen on parameter data types. Do they have an affect on what data is shown in the browse dialog box?
2
votes
2answers
1k views

Using Python Script tool in ModelBuilder to check if field exists, if not, create one?

I'm trying to create a script tool to use in ModelBuilder that will check the incoming dataset for the existence of a particular field. If the field exists it should simply go on to the next calculate ...
0
votes
1answer
18 views

Possible to determine how many rasters selected for a single GetParameterAsText()?

I wrote a script for ArcMap Desktop 10.5.1. The purpose of the tool is to buffer a feature to 1000ft, mosaic rasters together, and clip the raster to the buffered polygon. It works flawlessly; however,...
0
votes
0answers
111 views

Python script tool fails when processing rainfall data from Google Earth Engine

I am using the Earth Engine Python API in a script tool that I'm running from ArcMap. Essentially, the tool will allow the user to draw an area of interest, and from this area of interest, the total ...
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
435 views

Incorporating Python script into ModelBuilder?

Within ModelBuilder in ArcGIS, I am trying to add a script that will randomly assign "model types" (which is text) into the new field I have created in the attribute table. I checked to make sure the ...
1
vote
1answer
132 views

Clipping raster with shapefile and exporting each raster subset using ArcPy?

I want to clip a raster image using a shapefile with differents polygons (each polygon have its "FID_malla" value [FID_malla is large data type]) and save the subset rasters individually with "...
1
vote
0answers
75 views

Selecting pixels in raster using polygon selection tool in QGIS?

I want to reclassify landcover image manually with respect to online imagery. I am looking for a software/plugin/script to manually select raster pixels using polygon selection tool and could be able ...
4
votes
4answers
229 views

Problems with for iteration in arcpy

I want to fill a new field in a shapefile using arcpy. I have differents values so I am using for iterator to run all rows. But when I run the code all rows are filling with the latest row value. The ...
1
vote
2answers
675 views

Select Layer By Attribute Python Script Tool?

I'm trying to script another Select by Attributes tool. I want to be able to find a specific building using a field and zoom in to the location. However, my tool needs to allow a user to input any ...
1
vote
2answers
296 views

Installing Python module within code and running from ArcGIS Pro script tool?

I am trying to install a third-party Python package from within a Python script so that other users can run the script and the package can be installed and loaded without having to manually download ...