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

learn more… | top users | synonyms (1)

0
votes
1answer
88 views

Counting how many times a point goes through a loop and write the count to a text

I have a several feature classes that go through a loop to calculate points. I want to add up how many go through it each time so I can archive that number. I'm using ArcGIS 10.1. Lets say I have ...
0
votes
0answers
23 views

Points Missing on Import of LongLat data to SHP using ESRI script CreateFeaturesFromTextFile()

In ArcMap 10.0 I am using a 9.1-era ESRI script in Python called CreateFeaturesFromTextFile. There appears to be no ArcMap 10 update. The input text format is the strict format ESRI point,X,Y layout ...
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 ...
0
votes
1answer
39 views

Is there an equivalent to arcpy.ImportToolbox() in 9.3.1?

Is there an equivalent to arcpy.ImportToolbox() using ArcGIS 9.3.1? I'm assuming it would use arcgisscripting instead of arcpy but I can't find any documentation.
6
votes
1answer
142 views

Handle annotation layers with arcpy

I want to access annotation layers using arcpy (the purpose is to verify few text strings in text annotations). By annotation I mean draw tool annotations, not dynamic labels. These annotation layers ...
2
votes
1answer
26 views

Setting the output parameter in a toolbox to be a PDF

I need to allow a user to input a path and name where they would like to save their new map book PDF on their computer/drive. I have created a script where the user can input their mxd with data ...
0
votes
0answers
79 views

I could use some help with a bit of code optimization

See edit below. I posted here a couple weeks ago looking for some advice on the best way to iterate through data. You can find that post here. I have since done some tweaking to the code, and ...
0
votes
2answers
85 views

Python script to check node / edge coincidence

I have written a script with arcpy to test node and edge coincidence. Each edge (line) should have a node (point) at either end. If this is true, the script does not write anything. If there is node ...
0
votes
1answer
46 views

Using MakeFeatureLayer to select by location in arcpy

I'm trying to assign a state plane zone based on if a point intersects it. I make a feature layer from a feature class. It gets through the loop once and calculates everything correctly, but when it ...
0
votes
1answer
49 views

How to schedule a model to run at a certain time?

I'm trying to schedule a model to run at a certain time and have found this ESRI Blog post which is providing a good start. What I can't figure out though is where in the importToolbox function I tell ...
0
votes
1answer
62 views

automatic save outputs variables in the folder workspace using pyhon for arc map 10.1

I want to create python script with aim to import him in environment arcmap 10.1 and to make a hydrologic analysis because the scipt meybe can have many outputs raster file or feature class would ...
2
votes
1answer
73 views

Table analog of MakeQueryLayer

As of 10.1, arcpy provides the rather handy MakeQueryLayer function. This allows us to use arcpy to create query layers programmatically instead of having to go through MXDs (as was the case in 10.0). ...
2
votes
1answer
163 views

Using Arc 10.0 update cursor to replace <Null> value

I have been combing the help associated with (None) values in arc, and have not been able to solve the following problem: I have a a field with mixed Null and integer values: 0 100 I would like ...
0
votes
1answer
140 views

Polygon Neighbors Analysis script (ArcPy 10.1) producing erroneous results?

I'm struggling with a python script that is supposed to calculate a field for a polygon feature class. The calculation is of the average of a field value (P_TOT_DEV) for each of a given polygon's ...
0
votes
0answers
95 views

Using ArcPy, is there a way to change the color of a symbol in a UniqueValuesSymbology object?

I have an template mxd I reference with several pre-defined layers. The only variable I need to modify is the color of certain symbols in the layer. I have tried to modify and dig around the Symbology ...
0
votes
2answers
190 views

I get an ERROR 000622 when it checks for arcpy.DefineProjection_management

So the purpose of my code is to create a loop that copies shapefiles from a folder to my folder and change its projection 'GCS_WGS_1984'. Each shapefile starts with the year follow by the month and ...
1
vote
1answer
56 views

When using arcpy can I only calculate fields of a subtype and not the entire feature class?

I'm appending two sepearte shapefiles into one feature class with different subtypes. Is there a way to only calculate fields from a certain subtype?
0
votes
1answer
95 views

How can i use unicode characters in select by attribute?

I'm new to use python scripting for ArcGIS . I have unicode characters (arabic) in attribute table. I want to use these characteres in my script .when i use these characters in the script, the script ...
2
votes
0answers
37 views

Create custom raster pyramid using arcpy in ArcGIS 10.2

I have a arcpy script that runs the Point Density tool several times for the same extent, using the same number of neighborhood cells, but with cell size increasing at an multiple of 2 with each pass. ...
1
vote
2answers
78 views

Using Python to connect to Multiple SDE Database Connections

I am writing a script that accesses multiple sde Database connections. I have set the script to include accessing the environment workspace: import arcpy arcpy.GetParameterAsText(0) ...
1
vote
3answers
211 views

ArcPy Cursor iteration update

I'm trying to get the cursor to iterate through rows and fields looking for blank or null values and change them to 999999 but it's not changing anything. fc = ...
5
votes
1answer
158 views

Arcpy Pythonaddins Equivalent of arcpy.GetParameterAsText

I've build a neat little search arcpy script. The user opens any mxd, zooms to a location, chooses a corporate fGDB, and runs the tool. The user gets a list of all the populated feature class that ...
0
votes
0answers
40 views

Arcpy Closest Facility script not running correctly

I am running a script in ArcGIS 10.2 to automate the Make Closest Facility tool, as below, to identify the nearest chemist. This works fine. However, I then want to run it for another facility (a ...
2
votes
0answers
76 views

How to detect broken hyperlinks with arcpy?

I have zero experience with python but am trying to search for broken hyperlinks in a large gdb (temporarily converted to a shapefile)- Used code from a previous question (Hyperlink broken path - ...
0
votes
1answer
47 views

unable to modify records from one shapefile to another

I am trying to update the atrribute data of a feature class with respect to another one by matching a common field. But it is returning an error for the setValue command. My code looks like: import ...
0
votes
0answers
21 views

How to update attribute table of a shapefile on display automatically? [duplicate]

I have a shapefile attribute table on display. After some processing, I have to right click click Refresh to get updated version of table. I am wondering if there is a way using arcpy to update it ...
2
votes
1answer
92 views

How to get output value from Feature Compare (schema) and append to existing csv?

I am working on a data integration project and am trying to single out feature classes which have a schema that varies from two base feature classes (one for point, one for polyline features). I've ...
0
votes
1answer
113 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
2answers
149 views

Arcpy zoom to selected features not working

I'm writing a python script to automatically take some snapshots of my ArcMap in 10.2, but I can't get the zoom to selected features tool to work properly. I have a layer called carereport, which I ...
0
votes
1answer
67 views

AddLayer method failing when script in ArcToolbox is run from ArcCatalog

I need a 2nd set of eyes to do a sanity check, as I am not been able to figure out why a script that runs fine in pywin, does not run properly as a tool in a toolbox. Below is the script that runs in ...
1
vote
1answer
132 views

Error getting spatial reference as string in arcpy

I am trying to get the string associated with a spatial reference to print into an xml using arcpy and xml.cElementTree. Using the snippet: ... spatial_ref = arcpy.GetParameterAsText(3) ... Prj = ...
3
votes
3answers
383 views

Intermediate Data in Python Code

Is there a way to incorporate intermediate data (so that I do not have to select an output save location) in a python script that I turned into a tool? import arcpy, os from arcpy import env ...
1
vote
1answer
183 views

Query Layer not found ERROR 000229

My code executes in three steps: create FeatureLayer, create QueryLayer and join QueryLayer to FeatureLayer: arcpy.MakeFeatureLayer_management(**{ "in_features":features.get_dataset_fullpath(), ...
0
votes
1answer
71 views

Best Way to Get a List of Selected Rows for a Specific Layer using Layer Object in ArcGIS

What is the fastest/cleanest way to get a collection of rows that are selected in a certain layer? For some background, I am trying to hide selected features in a specified layer. The solution ...
1
vote
1answer
84 views

Arcpy scripts fail on big datasets - anyone has experienced similar behavior?

Here a question that is not extremely specific but maybe someone has had similar experiences... I have a few Arcpy scripts that work perfectly when used with small datasets but that silently fail ...
0
votes
1answer
45 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
59 views

Use a variable to calculate a field with arcpy as a script in a toolbox?

stringvariable = "banana" arcpy.CalculateField_management("c:\point.shp", "SUBDIRECT", "stringvariable", "PYTHON") I get an error saying stringvariable is not defined what's the deal? I check ...
1
vote
0answers
35 views

What causes “RuntimeError: DataFrameObject: Error in setting extent”?

I'm having a problem whilst trying to set extent on a python script. mapDoc is created using Web_map_as_Json string. Appreciate if anyone can help. result = ...
1
vote
1answer
103 views

Python package for processing GRIB data in windows

I would like to know what python packages can be used to process GRIB (Gridded Binary) data on a Windows system. I know there is something called pygrib, but to use that I have to use cygwin windows ...
2
votes
2answers
182 views

What is the most efficient way to iterate through folders and geodatabases?

I am looking at cataloging some data, and I have code that works, it just seems to take a lot of time to run through all of the items. The way this data is structured is a bit of a hindrance, ...
0
votes
1answer
124 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 ...
2
votes
2answers
73 views

python add fields that may have NULL values

I would like to use python to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have NULL values for one or more of the fields. ...
3
votes
3answers
630 views

Calculating X and Y of line start and line end using ArcPy?

I have a series of polyline shapefiles and I am trying to automate the process of calculating the X and Y coordinates of the line start and line end using Python. I have added the 4 fields (startx, ...
3
votes
0answers
84 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 ...
0
votes
2answers
141 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
160 views

how can I add all feature classes of the same name to an mxd in python

I have a bunch of folders which all have (almost) identical folder structures and file geodatabases of identical structures which in this folder structure. I need to add all of the same type of ...
2
votes
1answer
54 views

Arcpy Calculate Field Formatting Syntax

I am trying to field calculate a double field (PID) to a new string field (PIN). Using: qry = '"139-{}".format(!PID!)' arcpy.CalculateField_management(out, "PIN", qry, "PYTHON") Given a PID = ...
0
votes
0answers
38 views

Visualizing Layers with lyr-files in ArcGIS API for JavaScript

I do have a probably very simple question. I'm currently running a Python-Script on my Desktop-machine. In the end of this script the different layers that I've created will be visualized according ...
0
votes
1answer
32 views

Copying extents between features

I have a Building feature class whose individual building footprint extents I want to match to associated Level feature classes. Unfortunately, the Level data was converted from DWG files with only ...
0
votes
1answer
69 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 ...