Python add-in, GPToolDialog and Feature Set
Hi, I have a script tool that has a feature set (interactive user input, e.g. draw a freehand polygon) as one of its parameters and works OK when run from ArcToolBox. I plan to share this tool...
View ArticleAdd XY text to map - is it possible to create a new TextElement in a Python...
I'm trying to create an add-in tool for ArcMap that will allow the user to click on the map and insert a text element showing the XY coordinate of the point where they clicked. The functionality should...
View ArticleChanging Raster format and name with elif
Hello everyone, my name is Giovanni and I am relatively new to ArcGIS and Python coding. I have a problem I haven't been able to solve: I have a large amount of .tif raster which I need to transform in...
View ArticleRaster Calculator in Python
Hello, I want to execute the following line in a python code: SetNull(Raster2 < 2, Setnull(Raster2 != Raster1, Raster2)) Using the Raster Calculator, everything works fine. But I want to run it in a...
View ArticleMap Algebra statement to interpolate between two rasters
I am having some trouble converting a script I wrote for 9.3 to 10.0 using Map Algebra. It is a linear interpolation between two rasters on a log-linear scale. Here is the 9.3 code: Code:...
View ArticleMakeQueryTable_Management
I want to create a table called "Test" from inputTable called "Avg_Daily" using arcpy.MakeQueryTable_Management option of arcpy. However, I am getting error which says "Error 999999: An Invalid SQL...
View ArticleMakeXYEventLayer Issues with .csv
Hello! I have been working on plotting points on to a world map using latitude longitude coordinates in a .csv file, but they are always plotted in the wrong location. Here is my code:...
View Articlepython toolbox not working on many installs of arc
This tool works good on my workstation, but it does not work on some other machines It looks like the data type is wrong for the parameter. However the data type is set to GPFeatureLayer which is a...
View ArticleCreate Multiple Rasters based on fields within a polygon that represent model...
I'm still new to Python and have written the following python script based on the ArcGIS 10.2 help. I'm sure I'm missing some thing simple, but can't figure out why the script doesn't run, no errors...
View ArticleSimple CSV Question
I have a script that currently writes to txt and doc files that I want to be able to write to a csv.. Code: import arcpy import os #Initialize Parameters, Set workspace parameters, and intermediate...
View ArticleProblem in Deleting Feature Classes in Geo Database
Dear Sir I wrote a python programme to delete feature classes in a Geo database. it works, But feature classes are not delete. What is the reason ? and How to correct it? Thanks Padmasiri import arcpy...
View ArticleCan python add-ins reference other python add-ins?
I've got a combo-box working well but there's some text/input I want to grab from the user to use in its onEnter method. Is it possible to reference the contents of a second combo box in the onEnter...
View ArticleSobel edge detection
Hello, Can anybody tell what is wrong with this: it works in python window, but when I make it script tool does not work please help .............................................. import scipy.ndimage...
View Articlearcpy.da.SeacrchCursor locking itself? Memory Leak?
I was doing some testing with the da module. I'm running a simple script: Code: with arcpy.da.SearchCursor(x,"*") as rows: [str(x) for x in rows.fields] When I run this the first time, it...
View ArticlePassing AreaFieldName as a variable into CalculateField Failing
I am playing around with trying to pass the AreaFieldName of a polygon feature class into the CalculateField_management function. No matter which way I attempt to do this, it returns: Quote:...
View ArticleSetting the workspace to SDE
My script works as intended when the workspace and variables are set to a File Geodatabase, but not when connecting to SDE. The commented out lines show how the script runs when connecting to a File...
View ArticleAdding same field to X different feature classes
Hello! One of my goals this year is to start getting familiar with python. I'm still very new though I've taken programming courses in other languages. Let's say I have 10 different fields to be added...
View ArticleTrouble with 'Python for Everyone' course
Hi, I'm doing the 'Python for Everyone' course from ESRI http://training.esri.com/Courses/Pyt...0_1/player.cfm and my script isn't working. It says that Code: path =...
View ArticleHow do I use selection from one combobox and filter it from second?
I have two combobox's both using search cursor on same field to populate combo box. The code below is used to populate both boxes from this field. How do I use selection from first and filter it from...
View ArticleCalculate Equal-Area Slope of Longest Water Course
I need some assistance in getting started in developing a python script to determine the Equal-Area Slope for the Longest Water Course of a catchment. The Longest Water Course is represented as a 3D...
View Article