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

learn more… | top users | synonyms (1)

3
votes
2answers
250 views

scratch files left behind by arcpy.sa.Con

I have a Con() statement that creates two "extra" scratch files during it's processing, but that do not get cleaned up once the operation is over and the output is saved. r=arcpy.sa.Con(elv, ...
3
votes
1answer
163 views

How to get default parameter value for script tool from csv file?

I am fairly new to python scripting. I have just figured out how to read and write input parameters for a python script from a csv file. Now I am being asked to pre-populate the script tool dialog in ...
3
votes
1answer
151 views

How to make multivalue input script run from a toolbox?

I have a working python script: import arcpy sdeconnection = arcpy.GetParameterAsText(0) layerfiles = arcpy.GetParameterAsText(1).split(";") for layerfile in layerfiles: print layerfile lyr ...
3
votes
1answer
169 views

How to check if geometry is M aware?

I am trying to determine whether my shape file that I pass is in M-aware (has M value). I keep getting an error Attribute Error: 'Polyline' object has no attribute 'hasM' Not sure what I am doing ...
3
votes
1answer
1k views

Can't import arcpy in IDLE, pyscripter, or even ArcGIS10.1's Python window

After using arcpy and python for months with ArcGIS 10.1 without any problems I'm encountering something I can't work around or even find help with online. Something as simple as "import arcpy" is ...
3
votes
2answers
863 views

Can't Select and Export from Python Script

I am a novice in python programming but I am trying to learn by doing. I got stuck with this function a while back and can't seem to find a solution or a workaround. I am writing a script that is ...
3
votes
1answer
416 views

Issues with arcpy.sa.Reclassify

I have a raster file with classifcation codes, and want to reclassify valid codes to 1, and all others to 'NoData'. RMAP2 = arcpy.sa.RemapValue([[3.2, 1], [4.1, 1], ...
3
votes
1answer
430 views

How do I programmatically export a single Data Driven Page to JPEG?

I am trying to write a python script to export a individual pages to a jpeg. I am getting the error "PageLayoutObject: Error in SetDataDrivenPageID". Can anyone see where I am going wrong? import ...
3
votes
1answer
692 views

How to pan to a specific feature using arcpy?

I am attempting to use python and arcpy to automate the creation of some standardized maps I need to export for feature classes from various projects. I have a set of points and I need to export a ...
3
votes
1answer
170 views

ArcObjects/VBA to python Network edge to junction lookup IEdgeFeature equivalent in arcpy

In an effort to migrate a script that transfers attributes from a geometric network to a feature class (on a given network edge segment, what are the up and downstream junctions?) I would like to ...
3
votes
1answer
338 views

Update Arcpy version?

This is probably the answer to my previous question. The version of arcpy that I am using does not include GetNAClassNames naClasses = arcpy.na.GetNAClassNames(serviceAreaLayer) ...
3
votes
1answer
307 views

Batch Sum Fields Script

I have created a python script that batch summarizes all string fields within a fc table based on the concatenation of two fields. The script loops through a list of the fields, however it stops ...
3
votes
1answer
571 views

Python scripts runs from PythonWin but not ArcCatalog (ArcGIS 10)

I add a field to the target FeatureClass it is not present, via arcpy.AddField_management(...). Works fine from PythonWin, but the AddField call fails when the script is run from ArcCatalog. I have ...
3
votes
1answer
789 views

Select Layer by Location Produces Empty Output in Python

I am new to using Python scripts to execute ArcGIS tools. In my first script I am attempting to loop through many Select Layer by Location operations on overlapping feature classes. I want to create a ...
3
votes
1answer
646 views

Geocoding failure on concurrent requests with arcgis-10.0

I've created a small python synchronous geoprocessing script (ctagc) that runs on AGS. The script accepts a table (GPRecordSet) as an input parameter. The script then calls ...
3
votes
1answer
193 views

arcpy pydev 3rd party toolbox intellisense

I am just newly started to look at arcpy and i see that it has good intellisense for system toolboxes by default and also if you import a custom toolbox - the intellisense gets update also - however ...
3
votes
1answer
408 views

Disaggregating multiring polygon for editing, then recombining

BUMP? We have many rows of multi-ring polygons, displayed on a Flex front end. We need to be able to select a polygon (a row), split the rings for editing, edit them, then combine into one polygon ...
3
votes
1answer
119 views

Are there any alternatives to ArcGIS Locator Report?

I'm a pretty new GIS programmer and I've found ArcGIS/Arcpy to be extremely unstable. I'm trying to run a Locator Report in arcpy with no success. I'm wondering if there are any other alternatives? ...
3
votes
2answers
69 views

Efficient way to use a CSV to Define a Feature Class

I was provided an Excel Spreadsheet which had the definitions of fields for a feature class. There were several worksheets in the file, each containing field definitions for different feature ...
3
votes
0answers
50 views

Arcpy in Python Plugin for SPSS

Is it possible to run the arcpy module in the Python for SPSS plugin to run the search and update cursors?
3
votes
1answer
93 views

How can I exclude a field on a table from being copied?

I have a query "layer": >>> r = arcpy.MakeQueryLayer_management(r'C:\path\to\connection\file\connection.sde', 'TEST', 'SELECT T.ID AS OBJECTID, T.* FROM MY_TABLE T WHERE T.SOME_COLUMN = 1', ...
3
votes
0answers
82 views

How to extract zipped shapefile and check its shape type using arcpy module without writing on disk

I have a zipped shapefile saved on my disk. I want to extract it in memory and check the shape type. I'm using arcpy module and want to stick to only default modules comes with python installation. I ...
3
votes
1answer
143 views

Can folder connection in ArcMap Catalog window be added using python?

I have created a set of general scripting tools for map automation etc. in one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity is there any way ...
3
votes
0answers
221 views

Move shapefile from one folder to another using python [closed]

I'm working with shapefiles and using the ArcPy library. My script is creating a new shapefile based on a join and I want to know how to move the newly joined-shapefile from the environment location ...
3
votes
0answers
253 views

Is “Python scripting for ArcGIS” book a good reference? [closed]

I'm thinking of purchasing the Python Scripting for ArcGIS book. I haven't seen any reviews on the book. I was wondering if anyone here has read or flipped through it that can make any suggestions
3
votes
0answers
645 views

How to rotate and move polygons to different angles using ModelBuilder (or ArcPy)?

I have a few thousand polygons (all square) that I need to rotate to various angles that are in the attribute table, and then move so that each polygon gets moved 3/4 up from the original centroid, ...
3
votes
1answer
226 views

How come “Zoom to Polygon” always puts me in the middle of Nebraska?

This is an issue related to this question I'd asked a few days ago. I've got that code working, to an extent. Every time, though, that I double click on one of the Polygons in the attribute table that ...
3
votes
0answers
48 views

arcpy adding time to Raster Mosiac Footprint

I am trying to create a raster mosiac for use in animating data over time. The current workflow is: Create .gdb (arcpy.CreateFileGDB_management) Create Raster Mosaic ...
3
votes
1answer
177 views

Exporting records from an attribute table and placing them in a txt file

I am trying desperately to grab records in a shapefile's attribute table and copy them, with additional formatting to a txt file. Below is the code I have developed thus far: I have used the ...
3
votes
0answers
526 views

Reset python add-in

I have a toolbar which enables a second and third combobox when a selection is made on the previous. I would like to add a button to 'reset' the toolbar. Basically reload the toolbar to it's original ...
3
votes
0answers
92 views

Why aren't a layer's serviceProperties exposed if the data source is broken? [closed]

In ArcObjects you can get the service properties of a map layer by looking at its IWorkspaceName.ConnectionProperties property set, even if the layer is currently invalid due to a broken connection. ...
3
votes
1answer
141 views

Enabling ArcSDE Archiving with Python and C API using ArcGIS 10.0?

I have a script that does some register as versioned and updating privileges. How would I call into the c api for ArcSDE to enable archiving with python? ...
3
votes
1answer
1k views

ArcPy replaceDataSource

I'm attempting to replace a datasource in an outline map frame using ArcPy. The rest of the script seems to run OK, but after the script has run the datasource the datasource of that layer shows an ...
3
votes
0answers
218 views

How to symbolize vector features using RGB values stored in three fields?

I need to symbolize a vector layer in Arcmap based on RGB (or HSB - can do either) values found in fields in the attribute table. I'm working with up to 10 different datasets, each with over 100 ...
3
votes
1answer
2k views

error on mxd.save/saveACopy

I'm trying to use arcpy to save an .mxd and am having an issue. It doesn't matter if I use mxd.save or mxd.saveACopy I get the same error. I know it doesn't look like I am doing anything w/ it here, ...
3
votes
1answer
157 views

No placement inside feature dataset using arcpy XYtoLine?

When I run the following code with the outFC creation path set to a feature dataset inside a file geodatabase... arcpy.XYToLine_management(tempFC, outFC, "POINT_X", "POINT_Y", "NEAR_X", "NEAR_Y", ...
3
votes
1answer
823 views

Multiline VBScript Label Expressions in Arcpy

I am able to set simple label expressions, but when I try to set multiline expressions (which all VBScript expressions are) it does not get copied into the expression box properly. I have tried using ...
2
votes
3answers
767 views

SearchCursor() fails to read feature class

First of all, I would like to apologize if this problem is trivial for you guys since I am very new to ArcPy and Python in general. I want write a script to read attribute table from a feature class ...
2
votes
4answers
332 views

Error When Trying to Run Slope Analysis Script

I have written a script which is supposed to loop through all the rasters in a folder and perform a slope analysis on each raster and save the results in another folder. I keep getting the following ...
2
votes
3answers
442 views

Adding a new field and calculating area using Python

Using Python, how do you add a new field to your shape file and calculate the area in km2?
2
votes
2answers
467 views

How to select specific filenames nested within several folders?

I have hundreds of shapefiles that are stored in separate folders, which are nested within several other folders. Among the shapefiles I only need the ones that are named 'POINT*.shp' How do I get ...
2
votes
1answer
863 views

How to add feature class to MXD with ArcPy (Python)?

I am using ArcGIS 10.1 and I am trying to add a feature class that I create to an MXD, so that I can join to it. This all needs to be done using Python. Is this possible?
2
votes
2answers
2k views

how to get ALL FIELD NAMES from table? (using arcpy.ListFields)

I have a table: , Script at ModelBuilder's "calculate values": Expression: a("%path%") Code BLOCK: def a(path): fields = arcpy.ListFields(path,"FID_*") for field in fields: return ...
2
votes
2answers
1k views

ArcGIS and Python Issues with Different Versions

As we know, there are few versions of Arcgis (9.x,10) and Python(2.x,3.x) are in use. Issues are facing when we run scripts/toolbox of arcgis since the script written in one version of python and the ...
2
votes
3answers
2k views

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy?

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy? is it possible to use ArcGIS 9.3 Geoprocessor Programming Model within ArcGIS 10?
2
votes
1answer
225 views

How to change value of an individual pixel using arcpy?

I want to change the value of an individual pixel in a raster using arcpy. The code I wrote for changing the value is below, but it changes all of pixels in my raster. How can I set an individual ...
2
votes
2answers
82 views

Performing an Arcpy code using Python on all shapefiles in a folder or geodatabase?

I have a geodatabase with many polyline feature classes all with different names. I would like to write a code in python ArcGIS 10.1 to use a geoprossing tool on all classes in the gdb. How would this ...
2
votes
3answers
296 views

How to set Definition Query on ArcPy layer from shapefile?

I'm trying to determine options to set a layer definition query using ArcPy. I know that it is possible when using arcpy.mapping.ListLayers(). However, in this scenario I am loading in ...
2
votes
1answer
109 views

How to calculate a field in using updatecursor?

I'm trying to simply add a string in front of a group of numbers from another field in a new field. The filed I'm using update cursor in is GIS_ID_PAM and I'm trying to bring over numbers from a ...
2
votes
2answers
148 views

Why use “ from arcpy.sa import * ”

Previously on the following post: How to get an extent for Raster using python A user edited the original Python script by adding the following code: from arcpy.sa import * Why did he do this and ...