All Questions
Tagged with arcpy python-script-tool
420 questions
0
votes
2
answers
46
views
Identifying feature without creating separate output
I am using ArcGIS Pro 3.2.
I hoping to use the Identity tool to cookie cutter a buffer(layer B) into a polygon (layer A) without creating a separate output feature class. Currently I am using the ...
0
votes
0
answers
33
views
Writing tool for stacking point features on given co-ordinate
I am trying to write a Python code for creating a geoprocessing tool which will be added as a toolbox in ArcGIS Pro (v2.6).
The tool will
Ask for a "Target point feature" as input for the (...
-1
votes
1
answer
91
views
Returning value from ArcGIS Pro custom tool (.py)
How do we return a value from a custom .py tool, so that when I run the tool in another script, it will return a value (such as a number, string, or tuple)?
Notice in the execute class function, I ...
1
vote
1
answer
35
views
Using CalculateField within a script tool to edit the shape of a polygon
I am working in ArcGIS Pro 3.2 and with Python 3.9.18
I am trying to replace the geometry of a polygon with the polygon from another layer. I have used this small calculate field expression to replace ...
0
votes
0
answers
45
views
Why is first output of ArcPy tool only one running?
I am attempting to write a python tool that uses the create routes, locate features along routes, and make route event layer tools (in that order). Essentially this is a three step process that I want ...
0
votes
1
answer
99
views
Select Layer by Attribute not working with variable, but doesn't give errors using ArcPy
I'm trying to make a simple script tool that allows the user to search a for a specific polygon in a feature class using a unique number.
Using the python window in ArcGisPro I run arcpy.management....
1
vote
1
answer
110
views
Automate map updating using data from a folder in ArcGIS Pro
I'm trying to automate map updating in ArcGIS Pro using Python. Essentially, I need the program to read a folder with GeoJSON files, import them into a map, and update it. When I use the code below, ...
-1
votes
1
answer
159
views
ArcPy "listElements" error reported
I'm writing a script to convert a CAD polygon feature in a shapefile, calculate area(ha) in a new field and zoom to it in a 25.000 scale.
import os, arcpy, sys
from arcpy import env
#PAR�METROS DA ...
0
votes
1
answer
109
views
Python Script Tool with validation not opening in ArcGIS Pro
I am trying to figure out why my ArcGIS Pro Python Script Tool with validation fails to open when I insert the block of code in my image.
def initializeParameters(self):
shpFile = r"C:\LPA\...
0
votes
0
answers
32
views
Reference dictionary keys in ArcGIS Tool Validation
I have a Python script that is stored in a custom toolbox in ArcGIS Pro. The script has a dictionary myDict that I want the keys of to appear as a drop-down list as an input for the tool.
I know how ...
2
votes
1
answer
48
views
Insert a variable into a lblClass expression
My script selects by date in a points layer, then creates a new layer made only of those points. The script then exports the attribute table for the new layer to Excel, turns off the original layer, ...
1
vote
1
answer
60
views
arcpy.GetParameterAsText Error 000539 and NameError
Trying to create a Python script tool to calculate fields that are persistent across some (not all) feature classes in several feature datasets. It worked fine with the variables for CNO and VID ...
1
vote
1
answer
70
views
Error 000725 when running ArcPy toolbox
I'm trying to run a script in arcpy and appears the error 000725 "output folder: Dataset C:.. already exists.
The script objective is to clip all shapefiles from a folder by a buffer layer. If ...
3
votes
1
answer
254
views
Esri Data Loading Tools don't generate data loading workspace
Recently, I deployed the Esri Data Loading Tools Python package into my cloned environment within ArcGIS Pro 3.0.3. With the process pretty fool-proof, given Esri's package manager interface, I was ...
0
votes
1
answer
98
views
ArcPy: Grid Index Features freezing and crashing ArcGIS Pro
I am trying to use the grid index features tool in ArcPy. However when I run it outside of the Python window in ArcGIS Pro, it freezes and crashes. When used within ArcGIS Pro it works fine. I am ...
0
votes
0
answers
47
views
Multiple Ring Buffer returns RuntimeError: ERROR 000824: The tool is not licensed
I'm creating a tool that will be used by the Geoprocessing widget on my organisation's enterprise server. When I attempt to run my tool, I get an exception:
ERROR 000824: The tool is not licensed
...
5
votes
1
answer
1k
views
Creating Checkbox list in Python script tool dialog ArcGIS Pro
I'm creating a Toolbox (.atbx) in ArcGIS Pro, that uses a Python script I'm developing. Basically, the feature I want to add in that tool is making the user to select (using a checkbox) a set of maps ...
0
votes
0
answers
192
views
How can I script 'Overwrite Table'
Here is documentation on it, but it doesn't have Python code associated. I want to script this so I can make it run automatically after another model runs as a precondition.
My current workflow is: in ...
0
votes
1
answer
152
views
Open a geoprocessing tool / custom script tool window as a result of python code compilation
I am trying to create a custom system for converting general geodata to S-57 standard.
This will require more than one custom tool/script, but I'd like to make the experience as user-friendly as ...
1
vote
1
answer
539
views
AttributeError: DescribeData: Method shapeType does not exist
Can anyone help me resolve this error?
Traceback(most recent call last): File "*file.py", Line 15 in
if (arcpy.Describe(lyr).shapeType) == 'Polygon': AttributeError:
DescribeData: Method ...
1
vote
1
answer
507
views
List layer by data type in python window, eg: Layer == Polyline or Layer == Point
I am trying to locate features along routes for polyline and point features in a map. The locate features along routes tool requires two separate parameters; one for polyline and one for point ...
0
votes
1
answer
110
views
Geoprocess generates a standalone table for layers, what is the correct parameter setting for my ArcToolbox?
I have a toolbox that is executing locate features along routes for a number of layers in a map. For each iteration of the locate features along routes I am expecting a stand alone table for each of ...
1
vote
1
answer
147
views
Using ArcPy for custom toolbox
I am trying to create a toolbox that will execute 'Locate Features Along Routes' in multiple layers and in two active maps in ArcGIS Pro. One map contains linear features to be located, the other ...
0
votes
1
answer
36
views
Creating an ArcPy script to add 3 layers into 200 .mxd files located in different sub-folder and importing the layer symbology .lyr with ArcMap 10.8
I need to update 200 MXD files by adding three layers with a specific symbology for each layer.
I use ArcMap 10.8
All the layers are in the same folder.
All the .mxd files are located in one folder ...
0
votes
1
answer
34
views
Creating Geodatabase Script Creator using ArcPy [closed]
I have been working on and compiling different code snippets to create a GDB Generator. Most of the code logic I understand, but there is some that I can't grasp. Below is the code.
Code:
#import ...
1
vote
1
answer
175
views
Setting default extent parameters in Script Tool
I have an ArcMap Script Tool that calls the "extent" parameter. It contains a pulldown for how to obtain extents (Default, Union of inputs, Intersection of inputs, As specified below, and ...
1
vote
0
answers
92
views
Clipping Polygons and creating a new polygon as a feature
I am doing a task using the ArcPy module in ArcGIS Pro. The task is to Clip a polygon feature class with another polygon feature class and return the remaining polygons as a new feature class. I have ...
0
votes
1
answer
91
views
Iterate through fishnet polygons for extents and update field
I am new to Python.
I'm creating a Script Tool in 10.8.2 that generates polygons from Create Fishnet of 1 deg x 1 deg and a new field GEOCELL. I need to update field GEOCELL with the lower left corner ...
1
vote
1
answer
182
views
Implement Script Tool with ModelBuilder as GeoProcessing Service
I built a model in ArcGIS Desktop 10.8.1 and want to implement a script tool at the end (inside the model).
All elements are using relative paths and %SCRATCHWORKSPACE%\ in the file paths (as ...
0
votes
0
answers
178
views
How to export shp and TIFF files from a list with Python
I'm a beginner in Python, and I am trying to write code that receives a list of TIFFs and shapefiles from an input folder.
The objective is:
Do a clip to a raster using the Extract By Mask and if the ...
3
votes
1
answer
1k
views
Arcpy Traceback error 000210: Cannot create output
I have been given the task of taking a script that was made by someone who has left and altering where it saves the files. This is originally a simple folder system but we are moving over to file ...
1
vote
1
answer
357
views
Creating a Multi-Step Spatial Join Tool Script (One point file to many polygons) with one point output
I am wanting to create a ArcPy Tool Script that will join a point file to multiple polygons. Ideally, the point file (input_fc) would be a parameter so it can be interchangeable. Then the polygons ...
-1
votes
2
answers
371
views
Adding text in Tool Help of Python script tool
How do I add some text in the section "Tool help" in a Script tool?
I leave a screenshot in case there are doubts about what I mean:
0
votes
0
answers
233
views
Create geoprocessing tool using ArcPy that buffers multiple inputs and then merges and dissolves them into one final output
I am trying to create a geoprocessing tool in ArcMap by way of Python that will accept multiple inputs (points, lines, and polygons) buffer them based on user input, and then take the results and ...
1
vote
0
answers
36
views
ArcCatalog - Script - Parameter - Choose a previous one [closed]
I am working on a script that automates the following process: from coordinates in excel spreadsheet to a map in mxd or kmz.
Because the set of coordinates are in two different zones, I have to ...
3
votes
1
answer
173
views
ArcMap tool dialog says relative paths are incorrect
I have ArcMap 10.7.1 and I have created a Python script tool and tool dialog to run on it.
I want to set a default value for one of my inputs on the tool dialog and have it be a relative path to a ...
1
vote
2
answers
122
views
Getting fields from layer calculated during process (output layer) for later calculate field that is parameterized using ArcPy with ArcMap
I'm working in Pycharm Python IDLE under ArcPy, to later work on setting up a toolbox in ArcGIS Desktop 10.7.
I have a large script running in Python that works fine without parameters. Now, I want to ...
0
votes
1
answer
486
views
Run arcpy-script as geoprocessing tool
I am trying to get my first python/arcpy script going, but I am stuck with implementing it into ArcGIS Pro. If my script is running inside the ArcGIS Pro Python-Window everything is executed well and ...
0
votes
0
answers
110
views
Create the loop for multiple raster convert to vector polygon using the arcpy scripting tool
This is my code which works only with the one raster image. But I need to create the tool that converts the multiple raster to vector in loop with arcpy.
import arcpy
from arcpy.sa import *
arcpy.env....
1
vote
1
answer
130
views
Update features based on multiple GetParameterAsText
I am trying to figure out how to update feature attributes by user input parameters (GetParameterAsText). Current script the user inputs a arcpy.GetParameterAsText(can be multiple) then there is a ...
1
vote
1
answer
250
views
arcpy.AddField_management does not work in tool, only in Python Interpreter
I am creating a tool in ArcGIS Pro where a part of the code creates a feature class (low_fuel_warning) and adds fields to it. When running the code in the Jupyter Notebook in ArcGIS, it works as it ...
2
votes
1
answer
170
views
Changing upper break value to decimal using ArcPy with ArcGIS Pro
My ArcGIS Pro custom script tool is based off of a script that changes break values from a user's input. I believe I've done all I can troubleshooting the existing script. I'm suspicious of the tool ...
0
votes
1
answer
449
views
Sharing Python Script Tool gives Error 000576
I'm distributing a Python script tool with folks outside of my organization.
I had always assumed the .tbx file and the script were self contained. But when someone else tried to run the tool, they ...
1
vote
1
answer
91
views
ArcPy - Export to PDF - Script tool - What kind of parameter is a PDF output?
I am making a script to output an export to PDF. However, when parameterizing this function as GetParameterAsText () in the script in ArcCatalog, I don't know what type it is in "Data type".
0
votes
1
answer
168
views
UpdateCursor gives RuntimeError that column does not exist
I have managed to get my previous update cursor to work without any hiccups. All I have done is change the fields the script needs to look for. The error I am getting is:
RuntimeError: A column was ...
-1
votes
1
answer
66
views
Python script tool gives IndentationError in ArcMap
I am trying to use my Python script for Merge in ArcGIS as a tool.
(to use this script in model)
But it occurs an error (below figure).
I don't know what problem is...
Python script : work in ArcGIS ...
0
votes
1
answer
49
views
ArcPy - Script tool to insert shapefile in MXD does not work
The following script has the function of inserting shapefile in an mxd project based on a previous one.
import arcpy
from arcpy import mapping
arcpy.env.workspace = arcpy.GetParameterAsText(0)
...
1
vote
0
answers
31
views
Parameterize script that serves as sub-tool of ModelBuilder of ArcMap
The following script is used to place shapes inside a .mxd project:
import arcpy
from arcpy import mapping
arcpy.env.workspace = r"C:\GIS\Test"
mxd = arcpy.mapping.MapDocument(r"C:\GIS\...
0
votes
1
answer
329
views
Invalid syntax on arcpy.conversion.FeatureClasstoFeatureClass()
I am using ArcGIS Pro 2.8.1.
In a Python script tool, I am trying to get a list of feature classes as an user supplied input parameter, and export all of them with an additional text string that is ...
0
votes
1
answer
221
views
How to add user input shapefile as a parameter into "GDB Creator" Python Script tool
I created a Python Script tool to create a GDB inside of a user defined folder path. I am trying to find a way to add another parameter in my script tool for a user to input a shapefile after they ...