A site-package created by Esri to expose ArcObjects to Python.

learn more… | top users | synonyms (1)

0
votes
1answer
192 views

Check multiple feature classes have same spatial reference

As the title says I've several feature classes. I want to check whether they have same spatial reference using arcpy
0
votes
2answers
938 views

arcpy layer issues

This should be a really simple process but I am having issues. I want to search a workspace for all files with a certain string and then add them to the current workspace with a selected symbology. ...
0
votes
2answers
520 views

Arcpy: replaceDataSource, cad_workspace

I am having trouble replacing the data source on CAD files using arcpy. Everything I have tried runs into this error: Runtime error type 'exceptions.ValueError' : Layer: Unexpected error Here is a ...
0
votes
1answer
805 views

How to use variable field name in arcpy.SearchCursor?

I have code that says fld = fieldName rows = arcpy.SearchCursor(fc) for row in rows: x = row.fld How do I use a variable for my field name in python ArcGIS 10 on windows? Thanks.
0
votes
1answer
359 views

Calculating length with Python and the PYTHON_9.3

(Please critic wholly if possible) If I have polyline data in NAD83 and I want to calculate geometry using the PYTHON_9.3 parameter from the arcgisscripting.create(9.3), I am getting mixed results. If ...
0
votes
1answer
32 views

Split a line from point but with a certain distance [duplicate]

I am using ArcGIS 10.2. I need some suggestion about this problem, maybe there is a certain tool, but I think no. I think some python code... but I do not know from where to start :( I have two ...
0
votes
1answer
30 views

How to create polygon feature class from UTM coordinates?

I am working to create a polygon from UTM coordinates. The script I am using fails with a "must be a sequence, not float" error: Traceback (most recent call last): File "F:/sample/clipTiles.py", ...
0
votes
4answers
44 views

Using Arcpy, how can I determine min and max elevation from a raster DEM layer within my current extent?

Using Arcpy, how can I determine min and max elevation from a raster DEM layer within my current extent? I'm currently using Data Driven Pages to centre the layout on each feature extent. I need to ...
0
votes
1answer
34 views

Using a Search Cursor with a list

I'm hoping someone knows the answer to this as I am pretty new to Python. What I'm attempting to do is create a list of .dbf tables using a wildcard which I've managed to do. From there my goal is to ...
0
votes
1answer
52 views

Create polylines from point array Python

I am working on building polylines from an array of points I have created from a csv file and am completely lost in building the lines. My code works as follows: I have the point array working, I need ...
0
votes
1answer
44 views

Updating file geo database table

I have an input csv file that I process using a python script and generate a new output csv file. I then, in the same python script use Table to Table (Conversion) in order to store the data from the ...
0
votes
1answer
29 views

Clip a shapefile based on raster extent with high accuracy

I am trying to clip a shapefile based on the extents of a smaller raster. I find the extent of the raster using this code: Extents = arcpy.sa.Raster(MyRaster).extent` Then, I use these lines to ...
0
votes
1answer
31 views

count attribute in raster

I'm trying to calculate the total number of counts a raster contains using python script. When I ran the script, I didn't get any error. However, I also didn't get the number of counts for each row in ...
0
votes
1answer
38 views

Converting Raster datasets into layers using ArcPy/ModelBuilder?

I am new to ArcGIS and ArcPy (just started using them on Wednesday). I am using a model to create a Point Density plot from a Shape File, with the output being a Raster dataset. I want to ...
0
votes
1answer
39 views

Creating new layers using ArcPy to define Definition Query for each field value?

I am trying to set multiple definition queries for one layer based on one field using python. ie. I have a City layer with a field that holds the city name. I want a copy of the layer in an MXD ...
0
votes
1answer
55 views

Executing tool comes back with an error arcpy.JoinField_management

I have this script snippet, written by Aaron. import arcpy import os #set workspace arcpy.env.workspace = "C:\\Users\\lambioch\\Documents\\Wetland\\New_Folder" #in the folder "New_Folder" is a ...
0
votes
1answer
39 views

Definition Query then Zoom to Layer Automation?

I'm trying to create something in here. I want to have an automated process of doing a DEFINITION QUERY then ZOOM TO LAYER with one step. the concept is like that, a dialog comes up with one form ...
0
votes
1answer
33 views

Adding field to table without path to table (python) [closed]

I want to add a field to my table in the FieldCalculator. import arcpy arcpy.AddField_management("veg8", "test", "TEXT") An error message occured doing this and I figured out that I need to set a ...
0
votes
1answer
63 views

arcpy Make Feature Layer using a where clause

From a table of lines and polylines I am I'm building a seperate table of points (nodes) with their X and Y coordinates stored as attributes. I want the nodes to be unique, so I'm checking to see if a ...
0
votes
2answers
46 views

Make lists of shapefiles using loop

There are the following shapefiles in workspace. L01-1983_01.shp L01-1983_02.shp ... L01-1983_46.shp L01-1983_47.shp L01-1984_01.shp L01-1984_02.shp ... L01-1984_46.shp L01-1984_47.shp ... ...
0
votes
1answer
29 views

I'm Having trouble with the Arcpy geometry.disjoint function

I have points along along a line. Points that intersect the segment of the line to return attribute information. My line as three connected segments. ESRI Docs says disjoint (second_geometry) ...
0
votes
1answer
41 views

Loading graph (.grf fle) into MXD using ArcPy?

I have hundreds of pairs of FGDB and associated MXD files. I need to insert a graph in each mxd linked to its corresponding FGDB. No problem creating graph, but stuck on how to get graph into mxd ...
0
votes
1answer
61 views

DeleteField_management gives ERROR 000308 Invalid field type?

I am attempting to delete a list of fields in a feature layer but am getting an error: Execute error: Failed to execute. Parameters are not valid. ERROR 000308 Invalid Field type Here is a code ...
0
votes
1answer
31 views

Update rows based on number and position in table

I'm trying to update rows using the update cursor, but based on the number of rows in a sequence of three list items. Looking at the list below, it needs to update first four rows to 'B', then the ...
0
votes
1answer
98 views

ArcGIS 10.2.1 Table To Table tool in Python script gives ExecuteError: ERROR 001156?

I work for an organization that just upgraded from esri arcmap 9.3.1 to 10.2.1 and I'm currently in the process of updating the python scripts. When running a script I'm getting hung up on a portion ...
0
votes
1answer
26 views

How to group numbers based on first digits and then find min/max? [closed]

I have been struggling all day with this. I wish Python were more like SQL it would be so easy for me, but I am still learning. Basically, I just want to group numbers based on their first four ...
0
votes
1answer
70 views

How to select a feature and get its fields by mouse click using Python Addin in ArcGIS?

I'm building a python addin tool in arcgis and I would like to click a feature, say a polygon on the map, and get the polygon's attributes,i.e. ID=3,NAME = "CITY3"...It's similar as the arcmap tool ...
0
votes
2answers
34 views

A tool as part of a dialog box

I have a button created using Python Add-Ins which pops up a dialog box which is built using wxpython. I am wondering if I can place a tool (Select Layer by Location) within that dialog box to get ...
0
votes
2answers
42 views

CalculateField_management no-success

The following script is suppose to do the following, similar to what was done here: Renaming a field using arcpy. Create a fieldlist. Read thru the fieldlist and create a new field named "OLD_" + ...
0
votes
1answer
25 views

arcpy to handle topology error inspector

I am now want to do topology check use python, but I don't know whether arcpy can realize the function in error inspector. May I call error inspector and get the error records(something like attribute ...
0
votes
1answer
41 views

Can I validate topology using python script when ArcMap is open?

I am testing on validating topology using python.The situation is when I run the script when arcmap is open, an error occurs which indicates the topology has already been opened (FDO error: ...
0
votes
1answer
48 views

Determine distance between two lines at multiple locations

We have a number of features that look something like this: I need to measure the distance between the edges of a track (two lines) for all the tracks, and flag locations where the track width ...
0
votes
3answers
121 views

Multiple Conditional Statement with in a Con Tool

Well i want to apply multiple conditional statements within a Conditional tool. My aim is to loop through a list of rasters and on the basis of a specified range assign each range with a constant 1, ...
0
votes
2answers
53 views

How to make variables output to user defined workspace

I am running a script in ArcMap and I want to reference the user defined workspace as an output instead of hard coding it in. I have the scratch output set as a user defined parameter. However, I ...
0
votes
1answer
38 views

Adding Rules to Topology with Arcpy: getting ERROR 000714

I want to make a very basic python script, however I keep running into error 000714 (general/unknown script error). The topology is created, the features are added to it, however the rule is not. ...
0
votes
1answer
30 views

Calculate text field based on codeblock query of numeric field

I am trying to populate a field with a L/R bank designation based on a route measure (as part of a larger script), but I am struggling. I have a shapefile created (tir_pts_lyr), I have a blank column ...
0
votes
1answer
104 views

Error with Python Script tool for ArcGIS 10.2 [closed]

I am trying to create an ArcGIS map tool that includes creating TINS and uses parameters. This tool works fine when taking the data from shapefiles, but when I use map layers, which is what I want it ...
0
votes
1answer
43 views

ArcPy - Add Layer from Cursor Selection

I am trying to add layers from the fields of a reference layer using select by location and a cursor. Also, want to prompt the user with a message box asking if they want to add the selected by ...
0
votes
1answer
64 views

arcpy absolute file path failing with AddLayer()

I have the following code: import arcpy.mapping as mapping mxd = mapping.MapDocument("current") print mxd.title df = mapping.ListDataFrames(mxd)[0] print df.name layer = ...
0
votes
2answers
75 views

Find the minimum elevation pixels from an elevation raster using arcpy

I want to create a python script to find the minimum elevation pixels from an elevation raster (aster,srtm) using arcpy and arcmap 10.1. The purpose is to reclassify these pixels. I have tried but I ...
0
votes
1answer
49 views

How to set parameter filters in ToolValidator?

I am populating parameter[2] using validation code provided by ESRI. How can I modify this code to repeat for parameter[3] what was done for parameter[2]? To elaborate...param[0] is a user supplied ...
0
votes
1answer
111 views

Creat point and update featuers spatial join

I have the following code that is in a tool. The tool creates a point on click, then auto sequential populates the "AddressID" field and also populates X_Coord, , Y_Coord. This part of the tool works ...
0
votes
1answer
44 views

How to restrict read only *.mxd file?

I have an *.mxd file and I don't want to save any edits to it after each session. Is there a way in 'arcpy' or python in general to restrict edit of *.mxd file? Any suggestions would be appreciative.
0
votes
1answer
117 views

How to use for loop to add and calculate new field?

I am trying to use for loop to add and calculate a newfield for 2 shapefiles and a different new field for 2 other shapefiles. When I tried to do these 2 loops as one, it did not work so I separated ...
0
votes
1answer
65 views

name 'AddressLocator' is not defined, Python created Address Locator

When I run this tool, I get the error 'name 'locator_AddressLocator_n_' is not defined'. My guess is that this is an issue with the path where the locator is trying to save to? So, I am assuming I ...
0
votes
2answers
78 views

Add value to a field Python

I was wondering if anyone can help me with some Python? I have a featuers Class with the columns KOMMUNE and GKR and some other columns.. Both columns are string. In the column KOMMUNE I have the ...
0
votes
1answer
91 views

Duplicating Features To Create A Pattern

I'm currently trying to take the 'Shifting Features' script from ArcPy Cafe and this SE response and apply it to a similar script that will one by one, through all the features in a feature class, ...
0
votes
1answer
76 views

problem with SelectLayerByAttribute management in script

hello my problem is that this tool works perfectly in IDLE or PyScripter programs, but if I use in the script in ArcGIS desktop this problem occurs: arcgisscripting.ExecuteError:ERROR 000582... why ...
0
votes
3answers
34 views

Minimum ShapeLength using arcpy.Polyline?

Please, i am creating lines using arcpy.array(point1,point2) --> arcpy.Polyline...but my ArcGIS create lines only with shape lenght 0.0002 and longer...why ?? I want to create also shorter lines cause ...
0
votes
1answer
26 views

Multiple vertices after editing giving wrong start and end x, y co-ordinates

I have a small problem which I have been fighting to solve but in vain. Initially I generated some polylines across the river at various locations. I found some of them are smaller in size and not ...