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
27 views

Reprojecting script runs without errors in Spyder and ArcGIS Pro script tool but desired outcome is not reached

I am new to Python and am attempting to write a script where the desired spatial reference is found on my Counties.shp and the other feature classes are in other projected coordinate systems. The code ...
1
vote
0answers
48 views

Python code error

import arcpy inputlayer=arcpy.GetParameterAsText(0) output=arcpy.GetParameterAsText(1) arcpy.Select_analysis( inputlayer, output,"LAYER = 'Unknown Line Type'") I am new to Python migrating ...
0
votes
0answers
73 views

Export multiple attachments per point feature from fgdb using python script

I use the following script for export of attachments from an arcgis fgdb. It is used inside a script tool. I have multiple attachments (relID) for every pointfeature (GLobalID) and I would like to ...
1
vote
1answer
41 views

How to get a codeblock in a tool?

I wrote a script in ArcGIS Pro Notebook. It runs there perfectly. Now I try to create a tool with the script. ArcGIS has problems to read my "codeblock" in CalculateField correctly. I think ...
0
votes
0answers
26 views

ArcPy TopoToRaster parameter settings

I'd like to create a script tool to create Topo DEM with TopoToRaster, but the parameters are not valid. I tried using the help: https://desktop.arcgis.com/en/arcmap/10.6/tools/spatial-analyst-toolbox/...
1
vote
1answer
61 views

Creating new Python Script tool with ArcGIS Notebooks

I am trying to create a new tool in ArcGIS Pro that is based on a python script written in the Jupyter Notebook interface. I realize I can write the script elsewhere and save it as a *.py file and ...
0
votes
1answer
25 views

Adding message error box when parameters do not satisfy some conditions

I have 3 parameters in my tool, including para0, para1, para2. These parameters will be the user's inputs. I would like to display a message box if para0>para1 or para1>para2 or para2>para3. ...
2
votes
1answer
28 views

Getting zmin zmax of a raster parameter in a tool validation in ArcGIS Desktop 10.7 toolbox Python script

I am developing a Python tool (my first one). The tool has 3 input parameters: a raster z min z max I am trying to get automatically z min and z max after the user specify the raster using the ...
1
vote
1answer
35 views

ArcGIS scripting convert FeatureClass to Shapefile with user-defined shapefile name [closed]

I am trying to convert a feature class inside a geodatabase to a shapefile at a location outside of the geodatabase. I am aware that I can use the function arcpy.conversion.FeatureClassToShapefile(...
0
votes
0answers
30 views

Using python to do a calculation on a set of numbers in a text field separated by commas [duplicate]

Using ArcGIS ArcMap 10.6: I have a text field in an attribute table that has comma separated values (example: 12,24, 64, 87,29 OR 13, 45, 32,21,34, 45). For this example, I will name this field VALUES....
1
vote
1answer
85 views

Is Python/ArcPy capable of delimiting strings with commas into different fields, and running a calculation based on those separate columns [closed]

Using ArcGIS ArcMap 10.6: I have a text field in an attribute table that has comma separated values (example: 12,24, 64, 87,29). For this example, I will name this field VALUES. Please note that ...
2
votes
1answer
92 views

Convert scripts for processing toolbox

Does anyone know how I can turn this console script into a script that I can integrate into the processing toolbox? I tried a few options, but I don't do very well in python, and I always get stuck. # ...
1
vote
1answer
88 views

Removing fields in an exported table using ArcPy [closed]

I am using ArcGIS Desktop 10.6: ArcMap 10.6. ArcPy script within a custom toolbox. At the end of my script, I want to export the attribute table of a File Geodatabase Feature Class into a .csv file, ...
1
vote
1answer
40 views

Creating file geodatabases in script tool after specifying path and names as GetParameterAsText

I am trying to create a script tool in ArcGIS Pro that uses 2 clipping feature classes to clip multiple other feature classes and save them to two new geodatabases I create in the script. I use 6 ...
0
votes
0answers
21 views

Display selected feature table in layout [duplicate]

l have table and want to display selected feature in layout (print version). When select other country (look image) show me these country data in print version. Mostly do this by copy and paste in ...
1
vote
1answer
27 views

Making vertical spacing between parameters smaller on ArcGIS Script tool dialog

I would like to make space between parameters smaller in ArcGis Script tool. For example, in the image attached I would like to make the distance between two parameter Standard terrain and User ...
0
votes
0answers
18 views

How to get parameter popup in Python Add-in ArcGIS?

I would like to generate a tool in Python Add-in ArcGIS with the popup interface as image attached. I use the Add-in Button but when I click the Button, the parameter popup does not appear. This my ...
0
votes
0answers
25 views

How to add a save and load button in a Python-addin ArcGIS?

I would like to generate a tool in Python-Addin ArcGIS as the image attached. I also like to generate the save and load button in the tool. My purpose is that when the user chooses the range ...
0
votes
0answers
19 views

Transforming raster in range of values from 3 to 8 into linear scale from 0 to 1

I am trying to convert a raster file with values ranging from 3.2 to 8.8 into a linear scale from 0 to 1. The conditions that i want to apply in the transformation are as follows: 3 to 5 gets 0, 5 to ...
0
votes
1answer
88 views

Obtaining XY coordinate when clicking on globe using ArcGlobe

Work in ArcGlobe and I want to calculate the coordinates of the globe latitude and longitude, but the coordinates from the mouse click is read from the screen, not the globe, because when I clicked on ...
0
votes
1answer
91 views

Measuring distance in ArcGlobe using Python AddIn

I want to make a Python script that will calculate the distance of the line I drew and output it in a special form, but I can't figure out what I'm doing wrong. import arcpy import pythonaddins class ...
1
vote
0answers
31 views

Reloading aprx that has been modified using ArcPy with ArcGIS Pro

I'm writing a python script tool for ArcGIS Pro that uses a custom GUI created with pyqt. I would like the tool to be able to add and remove layers from the main map in the ArcGIS Pro project it is ...
1
vote
0answers
29 views

Subtracting data between features using ArcMap

I have a layer that contains feature classes that store optimal elevation & existing elevation values for a place. Right now the existing and optimal are stored in different features under the ...
1
vote
0answers
23 views

Customizing ArcGIS toolbox layout [duplicate]

I am trying to create a customized tool in ArcGIS using Python Toolbox. Does anyone know how I can change the appearance (for example, size of a textbox or position of a parameter) of a parameter on ...
0
votes
0answers
29 views

All Python scripts broken in ArcMap 10.7.1

I recently was attempting to run a Python script that requires the lxml package. I couldn't figure out how to use pip to install it as it always defaults to Python 3.x. So, as a work around I just ...
0
votes
2answers
156 views

I want to create composite band image through batch processing using ArcPy

I have multiple Sentinel 2a raster images in separated folders at same location, which means every image is in separate folder. Now I want to create composite band of each raster. I have written a ...
0
votes
2answers
37 views

Access attribute names and add new attributes in processAlgorithm

How can I access the layer attribute names of the selected layer? I have tried checking on Google but all the methods are mostly for the previous version and I am using py3 version. att = source....
0
votes
0answers
28 views

Manually scale polygon feature in QGIS

I want to manually scale selected polygon feature in QGIS so I don't need to set any parameters, just click on the feature and scale it moving the mouse. In ArcGIS there is a Scale tool. I want the ...
-1
votes
1answer
74 views

Making tool in ArcGIS from Python script

I was trying to run a tool based on my Python script. So in the script Stak118 is the name of the final output and i got the Stak118 as output in this case. But I would like the output in the tool to ...
3
votes
1answer
161 views

Calling ModelBuilder model from Python script using ArcPy

I updated the code in the script below per suggestion. I receive the same results as described in my original post, here... I have a very simple Modelbuilder model (ArcGIS Pro, v2.6) that has a ...
2
votes
1answer
333 views

Changing hard coded variable value to user input in Python script with ArcPy

I have exported "Con Tool" script from ModelBuilder. The model has two input parameters one is the DEM and the second is "Long Variable". When I run the model it executes perfectly ...
0
votes
1answer
78 views

mxd.SaveACopy fails to save file using Python script

I have been struggling to build a model using ModelBuilder and Python scripts. At the end of the model, I would like to write a script which saves the MXD file using the actual current time of the ...
1
vote
0answers
38 views

Outputting temporary feature layer from geoprocessing script tool to current map (ArcGIS Pro)

This is my first time attempting to create a script tool. I have gotten my script to work when running it in the Python window in ArcGIS Pro, however running from the script tool is slightly different....
0
votes
0answers
56 views

How to integrate a Python Script into Processing Modeler in QGIS

I have a model in QGIS and I've generated a Python Script to calculate the matching between two strings (Levenshtein Distance with the FuzzyWuzzy Package) for one of the OUTPUTS. #####################...
0
votes
1answer
71 views

If conditional for multiple raster in ArcMap10.6

I have a list of four rasters and i want to apply a lot of if then statements using Python in ArcMap 10.6. I was able get the result using raster calculator with Con statements and i tried to use the ...
1
vote
0answers
34 views

Renaming Attachments

So I've been trying to download and re-name my attachments. I have been successful on ArcMap HOWEVER, the python tool I've been able to use only downloads one attachment per datapoint. I have multiple ...
0
votes
0answers
24 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
95 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
193 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
88 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
91 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
24 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
240 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 ...
1
vote
0answers
123 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
32 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 ...
0
votes
2answers
122 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
24 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
43 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
72 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....
1
vote
1answer
40 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 ...

1
2 3 4 5
9