Quantcast
Channel: Forums - Python
Browsing all 2485 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Batch Clip Process

Hi all, I am using below code to clip numbers of feature from Dan Patterson; #BatchClipFCs.py # #Author # Dan Patterson # Dept of Geography and Environmental Studies # Carleton University, Ottawa,...

View Article


Populate a field with Python in the field calculator using a list.

Dear all, I would like to create a modification of this code: rec=0 def autoIncrement(): global rec pStart = 1 pInterval = 1 if (rec == 0): rec = pStart else: rec += pInterval return rec Because I need...

View Article


Feeding Variable into arcpy.CreateAddressLocator_geocoding

I have had a lot of success feeding variables into data paths for all other geoprocessing tools (this needs to be in the design so the script can be passed around different systems without modifying...

View Article

I need help about updatecursor,thanks!

I want to delete the row which ZQBM field contains 331122001. any ideas, thoughts? i would gratefully appreciate it. import arcgisscripting gp = arcgisscripting.create(9.3) gp.workspace =...

View Article

List Index Out of Range?????

Can anyone tell me what "List Index Out of Range" means?? Thanks!! Code: import arcpy, traceback from arcpy import env mxd = arcpy.mapping.MapDocument("CURRENT") # Join Fields fc =...

View Article


close wxPython main frame within python addins

I have created a dialog box class (frame with couple of comboboxes -- shown only one below as an example) and calling it from a different class. The problem lies in closing the frame once i retrieve...

View Article

Determine Flow Accumulation GRID: Using Python; Map Algebra and NumPy

I'm currently busy with a hydrology study where I'm determining the location and structure requirements (culverts & bridges) for a proposed Railway Alignment. My initial assessment is based on the...

View Article

arcpy.ListSubtypes is not working

Hello, I am following ESRI Documentation link 'http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000021000000' to print the details of subtype associated with a feature class but for...

View Article


Using decorators for script tool interfaces?

I saw a neat example this morning of Python decorators that made me think: could this be a nice way to set up a script tool interface for functions? The way I set up tools now is as functions (so I can...

View Article


Exploring dbase with python script

Hi all, I've got a question and hope someone can help me. I've got two dbase (.dbf) which are looking like this: dbase 1: ID usage shape_area 1 living 50 dbase 2: ID usage shape_area 1 living 50 2...

View Article

link arcmap to excel- a button required

hello averyone. i have an application in arcmap, in which point locations are added in arcmap thruogh geoprocessing model, which is customized as a buttion and just one click load the locations from...

View Article

projectAs help

I'm attempting to implement some of the functionality found here: http://support.esri.com/en/knowledge...s/detail/40730 I need to acquire the x/y values where mouse click occurs, convert the values...

View Article

Python Schedule task not running because of arcpy.

Hi everyone, I have this really simple Python script, that basically copies a file: Code: import os, shutil, time originalSDDraft = "C:\\Esri\\test.sddraft" localtime = time.localtime(time.time())...

View Article


Tool Validator / Values List Help

All, I am trying to populate a Values List in a tool from selected features. I have 2 feature classes (Counties and Places). I am trying to narrow down the Placees that will populate the Values List. I...

View Article

AddLayer

I am trying to add a layer to the table of contents. In other words I want to be able to open ArcMap, open a toolbox I created and run a script that I wrote (which creates a layer file), and add that...

View Article


Text file as input (multiple) fo Reprojecting Images

Hello All, I am new to Python and generally struggle with even simple scripts. I have a list of images in different directories. I want to reproject them bulk using python. So first, I tried to open...

View Article

arcpy.da.searchcursor with expression

Just wondering if anyone has had any trouble with using a query expression with arcpy.da.searchcursor? I've used this successfully many time but I have code where I create table views from tables in a...

View Article


Add-in toolbar- ArcMap won't start, uninstall manually?

I've created a basic add-in toolbar using Python. It compiled fine, installed OK but now I can't start ArcMap, ArcCatalog etc- It loads the splash screen but then stops (no errors are raised) so I wish...

View Article

Pass selected text element as parameter

Hello, I'm wanting to create a script to convert the text in a selected text box to all caps...I know how to cycle through all TextElements / select an element based on its text value, but I cannot...

View Article

Arcpy changing current working directory

I can't seem to understand the following behaviour: Code: mxd = ur'G:\MapImageCreator\ImageTaker.mxd' print os.getcwd()                          # C:\Documents and Settings\dabkowsk\Desktop (where I...

View Article
Browsing all 2485 articles
Browse latest View live