The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
1answer
17 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
115 views

Modify a Python script to one that uses RasterDomain_3d fuctionality - and writes resulting shapefiles it to one

As I am not very experienced with Python I need your help. I managed to modify a Script (that has been posted here Get boundary of raster image as polygon in ArcGIS Desktop? by https://gis....
1
vote
1answer
32 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
21 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
45 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
2answers
195 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 ...
1
vote
1answer
36 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
1answer
98 views

Can I interactively type multiple string records as input for GP Widget?

I am running a GP script tool where a required input is set up as a RecordSet for the user to type multiple string values that will be used by the tool for further analysis. However, when I publish my ...
1
vote
1answer
52 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
2answers
55 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 ...
2
votes
1answer
630 views

Using List field function for Python script tool?

I am trying to write a simple script for a toolbox, similar to the Addfield_datamanagement toolbox. The script adds a new field to a table of a feature class or a shapefile with attribute tables. So ...
1
vote
1answer
64 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 ...
2
votes
1answer
57 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 ...
0
votes
1answer
27 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
29 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
42 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
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 ...
1
vote
2answers
48 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 ...
7
votes
2answers
5k views

Choosing string from dropdown list rather than typing it into Python script tool?

As you can see, in the above picture, I need to input the county name to finish the parameter setup. Can I change the last part from inputting string to choosing an item from a dropdown list? For ...
2
votes
0answers
265 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 ...
3
votes
1answer
54 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 ...
3
votes
1answer
62 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
1answer
189 views

Passing user-defined feature selection (by location) into geoprocessing widget in web app

I am creating a web based map with a custom script tool that is published as a geoprocessing service. I am using app builder to set up a geoprocessing widget, but am unsure of how to include a user ...
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
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 ...
3
votes
1answer
481 views

Adding button to tool dialog of Python Script tool?

I am getting stuck when I want to create a new python script in toolbox. The function I want to develop is to let user to input the user ID, then retrieve from the database the other values to allow ...
11
votes
1answer
121 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
vote
0answers
33 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 ...
4
votes
3answers
5k views

Working around ArcGIS Pro inability to export models as Python code?

ArcGIS Pro 2.1 does not allow saving / exporting of a model constructed with ModelBuilder as a Python script. It seems that the only way we can circumvent this limitation is to click on each ...
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] ...
0
votes
1answer
142 views

Creating tool from script using ArcPy gives error 000714

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 ...
1
vote
1answer
62 views

What is the right SQL query for this case? [duplicate]

I want to use input string in part of the SQL query, and the code has been posted below. import arcpy import os in_features = arcpy.GetParameterAsText(0) target_county = arcpy.GetParameterAsText(1) ...
1
vote
2answers
317 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
59 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 ...
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
99 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 ...
3
votes
1answer
484 views

Changes not persisting in ArcGIS server from ArcPy script?

I have a ArcPy script (10.2) which connects to an ArcGIS server (10.0) versioned geodatabase, via an .sde connection file in the Database connections directory through direct connect on a Microsoft ...
7
votes
0answers
480 views

Automating creation of ServiceDefinition from Python script tool of ArcPy without broken project data source? [closed]

Summary: I can create a ServiceDefinition through ArcCatalog or ArcMap, but when I try to generate the ServiceDefinition through python, it does not copy the /data folder with it, thus the script ...
2
votes
2answers
78 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
1answer
251 views

Using output parameters as input parameters in Python Script Tools?

I created a script tool in ArcMap 10.5. How do I set an output parameter from a tool in the script as an input parameter in another tool at a later point in the same script? Like: buffout = arcpy....
1
vote
0answers
29 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
45 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....
3
votes
2answers
4k views

Does arcpy.GetParameterAsText() have a data type?

import arcpy # Retrieve input parameters inX = arcpy.GetParameterAsText(0) inY = arcpy.GetParameterAsText(1) inDescription = arcpy.GetParameterAsText(2) incidentsFC = "C:/Data/Yakima/Incidents.shp" ...
0
votes
1answer
63 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
77 views

Debugging MinimumBoundingGeometry_management() gives ERROR 000210?

I created a script to envolve points with polygons using the same value or ID. The main tool was the "Minimum Bounding Geometry", and so far my script is working good, but to convert to toolbox script ...
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 ...