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

learn more… | top users | synonyms (1)

0
votes
1answer
251 views

arcpy.ListDatasets() returns emtpy list

I'm having trouble getting the ListDatasets (or any of the list functions) to return anything but an empty list when pointed at our SDE geodatabase, but the same code works for a file geodatabase. I ...
0
votes
1answer
115 views

Unique Values in validation

How do I ensure the same selection is not made on param[2] and param[3] both of which are populated from the same field using tool validation? import arcpy class ToolValidator(object): """Class ...
0
votes
2answers
183 views

How to pass expression to where clause in ArcPy? [duplicate]

I want to pass a user defined variable into a where clause Syntax SelectLayerByAttribute_management (in_layer_or_view, {selection_type}, {where_clause}) #user input MTRsel = ...
0
votes
1answer
705 views

Arcpy ListLayers function returns only the first sub layer in a group layer (as opposed to the group layer AND all sub layers of that group)

I thought the arcpy.mapping.ListLayers function in ArcGIS 10.1 was supposed to return group layers AND all of their sub-layers, but my script is only outputting the first sub-layer in a group layer. ...
0
votes
1answer
93 views

How to reproject Network Dataset from GCS_WGS_1984 to Web Mercator?

I need to know how to change the coordinate system of my feature dataset with its network dataset from GCS_WGS_1984 to Web Mercator. Once I know how to do this, I would like to make a tool in Python ...
0
votes
1answer
80 views

Looping on the Select_analysis tool

Im trying to perform a loop on the Select_Analysis tool in Arcgis. Code looks like this: inputfile = open("locality.txt", 'r') # locality.txt is a txt file of locality names loc_list = [] for line in ...
0
votes
1answer
250 views

Is there a way to change environment settings of a dataset without creating a new one?

I am trying to change the environment settings of an existing dataset. I found a workaround by first changing the environment settings in the SDE-database and then create a new dataset with now ...
0
votes
1answer
223 views

How to set coordinate system on raster catalog with arcpy?

When creating a raster catalog, if the optional coordinate system fields for the raster and geometry columns are left empty, they will be stored as unknown. What geoprocessing functions in arcpy ...
0
votes
2answers
435 views

Help writing script using a shapefile - select by attribute

I am trying to take an existing shapefile and narrow down the attributes using the 'select by attribute' The problem I am trying to solve is: Find parcels that have an acreage >= 100. The code I ...
0
votes
1answer
620 views

Can an arcpy.da.SearchCursor be used on a dataset residing in a ParcelFabric?

I'm using ESRI's LocalGovernmentMI.gdb data model and am managaing parcel data in a ParcelFabric dataset. I'm trying to use a search cursor on the ParcelFabric_Parcels dataset but I recieve this ... ...
0
votes
1answer
272 views

Help with Python Update Cursor syntax

I'm having trouble running a loop to update the values in a particular field in attribute table by reading from a csv file. Any input is greatly appreciated. The following is the sample code: import ...
0
votes
1answer
414 views

Stop a Cursor loop when only 1 item is selected with Python

I am trying to create a Cursor that goes through a selection process and stops looping when only one feature is selected. Basically, as the Cursor loops it subsets a selection, and instead of going ...
0
votes
1answer
798 views

ListFields (arcpy) not reading from layer

I have a very simple python script that opens an mxd from a folder and then loops through each layer, and finds a ObjectID field and changes the alias name. #setup import arcpy from arcpy import env ...
0
votes
1answer
854 views

How to use VBA in the field calculator, to copy the last 7 characters to a new field?

Im using ArcMap 9.3. Im looking for a VBA code to use in the field calculator to make a new field of the last 7 digits of a "pin" field. For example. my pin is 00-00-999-999 and i want it to ...
0
votes
1answer
2k views

arcpy.RegionGroup fails with error 999999. Workspace or data source is read only

outRegionGrp = RegionGroup(inRaster,"EIGHT", "WITHIN", "ADD_LINK", valToIgnore) arcgisscripting.ExecuteError: ERROR 999999: Error executing function. Workspace or data source is read only. The table ...
0
votes
1answer
473 views

Looping Dataframe in Python doesn't Return Expected Results

I'm creating a python addin script to be used on some mxd's I have created as templates. Each map contains 2 dataframes. I need to loop through each dataframe and do some processing on each. I set my ...
0
votes
2answers
860 views

trouble with UpdateCursor where clause in arcgis 10.1

I'm trying to use UpdateCursor in arcpy, but the where clause I'm using seems to be causing trouble. However, when I open up the table in ArcMap and use Select By Attributes with the exact same clause ...
0
votes
1answer
451 views

raster in TOC to geotiff on disk in ArcPy

I am really hoping that someone out there who knows a bit about ArcPy in ArcGIS10 can help me out. I am attempting to automate some work w/ netcdf files. Basically, I am able to automate the creation ...
0
votes
2answers
1k 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
1answer
880 views

It is possible to edit selected features with Python?

I'm trying to edit some fields of the selected features in ArcMap. It's possible to do this with Python (ArcPy)?
0
votes
1answer
31 views

How do I load multiple shapefiles into the same existing feature class?

I have a hundreds of shapefiles and, based on the filename, I need to load it into one of three feature classes (points, polylines, or polygons). My code works until it tries to load the second file ...
0
votes
1answer
40 views

Replacing arcpy.AddMessage() with open source?

I've recently inherited some old python scripts that contained ArcPy modules. I'm using version 10.0. I am looking for an error messaging system that replaces arcpy.AddMessage()?
0
votes
1answer
20 views

How do I get a result's status description instead of a status integer?

This code snippet outputs 4 when the run was successful. Great! But how is displaying a number useful to anyone unless that person knows how / where to look up the status integer? I could perform a ...
0
votes
2answers
80 views

How to add XY point and update attributes with ArcPy 10.0

I would like to create a script tool that takes 3 parameters in ArcMap: Google maps coordinate (e.g. -33.876846, 151.215117) text string text string The coordinates would define the XY geometry, ...
0
votes
2answers
78 views

Populate cross street name at intersections

Just a follow up of an older post seen here: Python script/Model to populate cross street names at intersections I need to create a shapefile of Road segments with a "To_Road/s" and "From_Road/s" as ...
0
votes
1answer
28 views

How do I create a new feature class from an existing FC and a WHERE clause?

I have a feature class. I want to copy the FC and use a WHERE clause to limit the rows copied. I tried using the CopyFeatures_management but it throws an error on the CopyFeatures_management() line. ...
0
votes
2answers
16 views

Arcpy/python Syntax Error. Variable Creation

I'm having a problem when trying to create a new variable within python. i = datetime.datetime.now() tme = i.strftime('%d/%m/%Y') print tme This portion of the code creates a date variable (tme) in ...
0
votes
1answer
55 views

Error in python code for loop using SearchCursor, selectlayerbyattribute, and copyfeatures tools

I am fairly new to python scripting for ArcGIS. I am trying to create maps where each county is selected and then copied into a new layer with only that county's data. Then, I used ApplySymbologyFrom ...
0
votes
2answers
36 views

RuntimeError: Underlying DBMS error ORA-00936: missing expression schema.tableName STATE_ID is not column in table?

I created a search cursor to retrieve some data from a feature class. The broken example shown below is used successfully in other scripts I created. The only difference that comes to mind is I'm ...
0
votes
1answer
31 views

Changing field values using arcpy

Say I want to make my field buff_dist longer than by 400ft, I want to write a code that will go through the table and change the field value by adding 400ft to it's value. How would I write that? I ...
0
votes
1answer
26 views

How do SearchCursors sort records

How do arcpy searchcursors sort records if there is no 'sort_field' specified? It seems, on the surface, to sort ascending by the primary key. However, I don't want to base my script around this ...
0
votes
1answer
52 views

Merge shapefiles in folders and subfolders with arcpy

I try to merge 20 shapefiles in order to get one shapefile that include all the features. All shapefiles are called "migrashim", and they spread in big folder that divided to a lot of sub folders. ...
0
votes
1answer
47 views

How can I refer to two tables in ArcPy's CalculateField_management? [closed]

I tried to refer to the different table's fields just like I saw in How to Calculate Field in joined table using ArcPy? but it doesn't work. There are two tables in my example. I have created table ...
0
votes
2answers
38 views

What fields can the CalculateField_management expression parameter contain?

What fields can the CalculateField_management expression parameter contain? I mean the parameters can be the fields what are in the output table, or can they be a field of another table too? There ...
0
votes
1answer
59 views

How to show the attribute table of selected features using arcpy?

Is there a way to show the attribute table of selected features using arcpy? Maybe in the mapping module? I would like to be able to select some features and then have an Add-In button that ...
0
votes
1answer
61 views

Trying to update separate table with SearchCursor

Learning Python to use in ArcGis 10.2 and becoming bald I want to get value from a certain field from one attribute table into another attribute table. IN PT1, If Meas of Object1 > Meas of Object2, ...
0
votes
2answers
82 views

Find duplicates in a field then update another field with a Y or N with Python (ArcGIS)

I am attempting to create a python script (ArcGIS 10.1) that will identify duplicated records within a points shapefile with a Y or N (possibility of over 5000 records). Similar to this: xyCombine | ...
0
votes
1answer
62 views

ArcPy Error - 'continue' not properly in loop [closed]

Is there a way to get the continue function to work? Here is my code:
0
votes
1answer
37 views

Layer still in map after running arcpy.mapping.RemoveLayer?

I'm trying to run a script that removes a group layer from a set of map documents, the code runs and the correct zone to be deleted prints out, However, when I check my map documents, the layer is ...
0
votes
2answers
96 views

UpdateLayer with arcpy

I am trying to use updatelayer in three mxd's. Each mxd has 3 data frames. I am getting an error, can anyone help? import arcpy,os,sys,string import arcpy.mapping from arcpy import env env.workspace ...
0
votes
1answer
54 views

Can not SET a Value in table using Python?

I'am trying to set values in table, the code run good, i don't got errors, but nothing is done ! I'm using Arcgis10.1, arcpy and Python This is the code : import arcpy import math import arcview ...
0
votes
1answer
49 views

Catch Execute Error and Continue (arcpy)

I've got a script that does a number of Date/Time conversions using arcpy.ConvertTimeField_Management. A common issue that I need to handle is when the field is empty and an execute error is raised: ...
0
votes
2answers
57 views

Optimizing script with in_memory selection

I had a problem solved here. I had 2 features: polygons and points, both containing similar attributes(example: street name, number). Each polygon must have equivalent point added(same street name, ...
0
votes
1answer
21 views

Loading data from shapefiles into specific feature classes

I am trying to bulk load a collection of shapefiles into empty feature classes in ArcMap 10.2. The issue here is that the names of the shapefiles and the feature classes need to match up. Is there ...
0
votes
2answers
37 views

Randomly assign a value to a specificed number of rows in a feature class in ArcGIS

I have several feature classes, each with a million or so rows. In each of these feature classes I have an attribute ("STATE"), the value of which I want to randomly assign to one or another state (so ...
0
votes
1answer
71 views

How to set feature coordinates to values in attribute table?

I have some shapefiles that were produced programatically, and everything came out okay EXCEPT that the geometry information was not written correctly. The coordinates for each feature are null. ...
0
votes
1answer
26 views

Data frame index

Can anyone know how to make index ,in arcpy, for a several data frame in one mxd? That question related to this question : Insert layer file to specific data frame
0
votes
1answer
81 views

How to list attributes in a field using Python?

I'm using ArcGis 10.2.2 and I'm creating a model in ModelBuilder. I want to know how I can list the attributes of a field and then make a selection for each unique attribute using Python. I have a ...
0
votes
2answers
102 views

Same python code works in arcgis python window, but fails in pyScripter

This code works in the arcgis python window but in PyScripter, this warning message had been written: Traceback (most recent call last): File "", line 16, in File "C:\Program Files ...
0
votes
1answer
40 views

Arranging elements horizontally in ArcGIS tool

Is it possible to arrange multiple check boxes horizontally in a tool and changing the parameters dynamically (adding/removing) based on user selection of check boxes?