Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python-script-tool]

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

0
votes
0answers
34 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
38 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
29 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
47 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
37 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
55 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
25 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
40 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
30 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
30 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
42 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
44 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
43 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
72 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
48 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
32 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
60 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
1answer
93 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
125 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
60 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
107 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
31 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
36 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
677 views

Check if field exists, if not, create one - Model Builder Script tool

I'm trying to create a script tool to use in Model Builder 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 ...
0
votes
1answer
17 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
75 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
30 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
164 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
59 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
38 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 ...
0
votes
0answers
12 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 ...
4
votes
4answers
216 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
287 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
0answers
151 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 ...
0
votes
1answer
112 views

Issues flattening row from a table python

I'm trying to merge duplicates rows using this Python script. After I run the script I get this error and the output just drop the duplicates and it doesn't merge any duplicate row. I want to create a ...
1
vote
0answers
92 views

Using Pivot Table in ArcPy?

I’m using a Python script to reproduce the Pivot tool in ArcGIS and when I run the script the output comes with many duplicates and this is an intended feature of the pivot tool. Nonetheless, I’m ...
0
votes
0answers
19 views

arcpy.MakeFeatureLayer no new layer added to TOC [duplicate]

Having issues with arcpy.MakeFeatureLayer_management within script tool since it's not adding layer to mxd. typically it would add the layer with its attributes selected, but when running within tool ...
-1
votes
1answer
94 views

Need to convert script to tool Error 000714 [duplicate]

The script is fully functional, but I need to convert it into a tool which will allow the user to customize work environment, expression, name of shapefile, name title text, update date text ...
2
votes
1answer
92 views

Using ArcMap I want to add new Fields into a gdb using Python [duplicate]

I'm new learning as I go, I have read some of the Answers posted, and I've gotten this far, I was able to add a new field to a GBD, I wanted to have the Length be 50, but it created a field with 255, ...
0
votes
0answers
90 views

Write Excel values in to the attribute table of a shapefile in QGIS

I am using QGIS version 2.18.19. I have written a standalone script which converts a DXF file in to polygon shapefile. Now I want to write data into the attribute table of the polygon shapefile from a ...
2
votes
0answers
143 views

Adding feature class and applying symbology in ArcGIS Pro using ArcPy?

Using an ArcPy script run from a toolbox, I want to import a feature class from a geodatabase into an ArcGIS Pro 2.1.2 map and then symbolise that layer based on a lyrx file stored on disk. Here is ...
0
votes
0answers
74 views

Creating tool from script using ArcPy?

I have been trying to create a tool from my script, but it doesn't work. Im not sure if there is a problem with the way the script was written. Script Properties: After running tool i recieve this ...
0
votes
0answers
116 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 ...
0
votes
1answer
11 views

Choosing Data Type of signature file for parameter in Python Script Tool for Maximum Likelihood Classification?

I am working on a script tool for a maximum likelihood classification and I would like to set the signature file as parameter. What data type do I have to choose in the "Add Script" dialog box in ...
1
vote
1answer
39 views

Set “MultiPatch” as feature class filter in arcpy scripts (ArcMap10)

As mentioned in ArcMap10.X documentation (http://desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/programming-a-toolvalidator-class.htm), it is possible to set filters in tool parameters of ...
2
votes
0answers
52 views

Adding script tool to ModelBuilder in ArcMap?

I have create a script and want to add it to the model I have provided. The code is: import sys, string, os import arcpy import numpy Table = arcpy.GetParameterAsText(0) Field1 = arcpy....
1
vote
1answer
153 views

Cannot run some Grass commands in Python using grass script

I am trying to make a Landsat geoprocessing script for calculating vegetation indices using Grass modules and Python. I am fairly new at using Python for Grass and I have managed to call and create ...
1
vote
1answer
242 views

Create Filter Parameter in Python Script Tool from Unique Set of Values in Field

I currently have a python script tool that reads in a feature class and (among other processes) subsets the feature class based on a value in one field, 'REGION'. Instead of having all subsets created,...
2
votes
1answer
54 views

Why is “arcpy.GetParameterAsText” deleting Target Feature Class?

Originally I asked Why is this Python Script (using XYTabletoPoint) Deleting the target Feature Class?, but have since narrowed down the line that is deleting my target Feature Class. Surprisingly, ...