521 reputation
311
bio website
location
age
visits member for 3 years, 9 months
seen 9 hours ago

Oct
2
answered Select Layer by Attribute: SQL and variable problems
Oct
2
answered Is there a way to save Geoprocesing results?
Oct
1
answered Use updatcursor to replace values in multiple fields
Oct
1
comment Use updatcursor to replace values in multiple fields
Try printing out the fields parameter you're getting from arcpy.GetParameterAsText(3). I may be wrong, but if you select multiple fields, you'll get "field1;field2;field3" as a string. What Update Cursor is expecting is a python list of fields. Use fields = arcpy.GetParameterAsText(3).split(';') to get an actual list. However, that's going to reveal another problem - buildWhereClause will only accept one field name, not a list of field names. As Baltok mentioned though, we're going to need error messages.
Sep
10
answered If/then Field Calculator
Sep
10
comment 'List indices must be integers not tuple' Error
Cool. I edited my answer to include the "*" param for anybody else looking at it.
Sep
10
revised 'List indices must be integers not tuple' Error
edited code based on user tay bro's findings that second parameter of SearchCursor is required.
Sep
10
comment 'List indices must be integers not tuple' Error
Edited my answer. arcpy.da.SearchCursor returns a tuple, not a row object like the old arcpy.SearchCursor returns. I'm still on Arc 10.1, so I haven't used the da module at all.
Sep
10
revised 'List indices must be integers not tuple' Error
arcpy.da.SearchCursor returns a tuple, not a row object like the old arcpy.SearchCursor returns. I'm still on Arc 10.1, so I haven't used the da module at all.
Sep
10
answered 'List indices must be integers not tuple' Error
Sep
10
comment 'List indices must be integers not tuple' Error
However, keep in mind my other comment. All rowvalues is going to be is a list of field names at those indexes. It will not actually be values from outfc at all. Your insertRow line will fail next because you are not inserting row objects which is what insertRow expects, since row will just be a string (the name of a column in outfc)
Sep
10
comment 'List indices must be integers not tuple' Error
Also, your error is in the fact that you are using a list improperly. if you want to create a subset list of certain field names from allrowvalues you'd have to do it like rowvalues = [allrowvalues[2].name, allrowvalues[3].name, ...]
Sep
10
comment 'List indices must be integers not tuple' Error
allrowvalues doesn't contain what you think it contains if I'm understanding your intention. ListFields() will return a list of field objects from the input feature class. It does not actually return the values in those columns.
Feb
5
awarded  Yearling
Feb
5
awarded  Nice Answer
Apr
15
awarded  Caucus
Feb
7
awarded  Necromancer
Dec
13
comment Why does tool take longer to run when in Python script?
I would guess that your next step then is to look into speeding up your ArcGIS start time if that 1-2 minutes is unacceptable. here's a previous question I found related to getting Arc to start quicker gis.stackexchange.com/questions/20437/…
Dec
11
comment Why does tool take longer to run when in Python script?
How much extra time are you taking in actual minutes/hours? The overhead I'm taking about should be a flat 1-2 minutes at most on top of the normal running time.
Dec
6
answered Python: find a method to calculate the “inner centroid” (also known as labelPoint in arcmap) of a polygon