<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Python, Arc10 - copy shape field contents from one table to another. in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226789#M7852</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is just a read from one table (shapefile) and a write to another table (shapefile).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This would work in 9.3.1 (SP1, SP2) but no longer in 10, with or without SP1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; copyShape = Arow.shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; arrayShape = copyShape.getPart( )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; Crow.setValue( 'Shape', arrayShape )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # or Crow.shape = arrayShape&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;error is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;interactive input&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 941, in setValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.SetValue(*gp_fixargs(args)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: ERROR 999999: Error executing function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a polyline shape.&amp;nbsp; Arow is a searchCursor, Crow is an insertCursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;type(arrayShape) gives: &amp;lt;class 'arcpy.arcobjects.arcobjects.Array'&amp;gt;, and it looks to be populated OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also have a point copy I'm getting ready to test, so if there is a separate fix for that you might know of, I'd appreciate mention of that, too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Nov 2010 12:39:36 GMT</pubDate>
    <dc:creator>JohnSanders</dc:creator>
    <dc:date>2010-11-17T12:39:36Z</dc:date>
    <item>
      <title>Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226789#M7852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is just a read from one table (shapefile) and a write to another table (shapefile).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This would work in 9.3.1 (SP1, SP2) but no longer in 10, with or without SP1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; copyShape = Arow.shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; arrayShape = copyShape.getPart( )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; Crow.setValue( 'Shape', arrayShape )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # or Crow.shape = arrayShape&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;error is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;interactive input&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 941, in setValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.SetValue(*gp_fixargs(args)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: ERROR 999999: Error executing function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a polyline shape.&amp;nbsp; Arow is a searchCursor, Crow is an insertCursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;type(arrayShape) gives: &amp;lt;class 'arcpy.arcobjects.arcobjects.Array'&amp;gt;, and it looks to be populated OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also have a point copy I'm getting ready to test, so if there is a separate fix for that you might know of, I'd appreciate mention of that, too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 12:39:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226789#M7852</guid>
      <dc:creator>JohnSanders</dc:creator>
      <dc:date>2010-11-17T12:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226790#M7853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't speak to 10 (too many bugs yet to move over), but I can verify that this sort of thing did work in v9.3. Here's some v93 code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 19:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226790#M7853</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-17T19:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226791#M7854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't help you with v10, but if it ain't working there (in v10) it sounds like a bug. You should report it to esri. On a side: Pretty quickly I figuered out that due to a variety of bugs, v10 was not stable/compatible for much of my existing v9.3 and v9.2 Python code (this issue being yet another great example), so I guess that's why I haven't moved over there yet. I'll have to eventually though, and it won't be pretty...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Excerpt of a v9.3 script that, among other things, gets a shapefield value (searchcursor) and inserts it into a new sorted table (insertcursor) - Works great in v9.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#Process: Now write the sorted records to the new FC
message = "Sorting fields..."; showPyMessage()
searchRows = gp.searchcursor(inputLayer, "", "", "", fieldSortString[:-1])
searchRow = searchRows.next()
message = "Writing sorted records! Please wait..."; showPyMessage()
insertRows = gp.insertcursor(outputLayer)
recordCount = 0
inputLayerOidFieldName = dsc.oidfieldname
origOidPopulateSuccessFlag = True
while searchRow:
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Process: Every 1000 rows give a message about the progress of the cursors&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; recordCount = recordCount + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; if divmod(recordCount,1000)[1] == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "Writing row = " + str(i) + "..."; showPyMessage()
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Now read the old table and populate the new one
&amp;nbsp;&amp;nbsp;&amp;nbsp; insertRow = insertRows.newrow()
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fieldName in inputLayerFieldList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try: #you can't write the OID, length, area, etc. fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if outShpDbfFlag == False:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertRow.setvalue(fieldName, searchRow.getvalue(fieldName))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if originalOidFieldName not in ["","#"," "]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertRow.setvalue(originalOidFieldName, searchRow.getvalue(inputLayerOidFieldName))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; origOidPopulateSuccessFlag = False
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertRow.setvalue(fieldName[0:10], searchRow.getvalue(fieldName))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if originalOidFieldName not in ["","#"," "]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertRow.setvalue(originalOidFieldName[0:10], searchRow.getvalue(inputLayerOidFieldName))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; origOidPopulateSuccessFlag = False
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; insertRows.insertrow(insertRow)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; searchRow = searchRows.next()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:02:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226791#M7854</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T11:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226792#M7855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also, in your code, why not just:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Crow.setValue( 'Shape', Arow.shape) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why do the getpart() step?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, are you sure that your Shape field is actually called shape?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#v10 code? (not sure if it'll work)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shapeFieldName = arcpy.describe(myFC).shapefieldname&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Crow.setValue(shapeFieldName, Arow.shape)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 19:44:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226792#M7855</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-17T19:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226793#M7856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I may tried your alternate, shortcut one-liner -- same error in 10.&amp;nbsp; I don't recall if I tried it or not in my 9.3 code.&amp;nbsp; That code has been working well for a long time.&amp;nbsp; (Do you ever revisit your older stuff and say, "What the #^$% was this guy thinking?").&amp;nbsp; I'll give your code a try a little later and let you know.&amp;nbsp; Thanks for it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm finding that tools/functions in 10 are case sensitive now, and that setting .workspace and .toolbox don't necessarily mean anything (depends on the tool you're using!).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS.&amp;nbsp; My point writes that I mentioned above, worked.&amp;nbsp; Yeah, ESRI!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PPS. In the OP I meant to say that Arow came from a SearchCursor.next( ) and Crow came from an InsertCursor.newRow( ).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 20:15:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226793#M7856</guid>
      <dc:creator>JohnSanders</dc:creator>
      <dc:date>2010-11-17T20:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226794#M7857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have tried all of your suggestions with no good result.&amp;nbsp; I do not see that you do anything special for 'Shape' writes in your code example.&amp;nbsp; I can't really explain my use of .getPart( )!&amp;nbsp; Maybe it makes no difference?&amp;nbsp; I'm going to have to experiment on a 9.3.1 machine around here. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you for your input, though -- much appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 13:50:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226794#M7857</guid>
      <dc:creator>JohnSanders</dc:creator>
      <dc:date>2010-11-18T13:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226795#M7858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure about the Spatial Adjustment toolbar (I think an automated method is probably required here), but I should ask:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why do you need to copy the spatial data. I am guessing there is a good reason, but why not just use CopyFeatures() or something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I'll point out that v10 does support&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so you could use arcpy and gp functionality together in the same script...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Do you ever revisit your older stuff and say, "What the #^$% was this guy thinking?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ha! Always, but I have found that ~80% of the time when this happens, I will start rewriting the code in a "better" way only to find that yes, there was a reason I did it that way in the 1st place, and the last 2 hours I spend "correcting" the code has been totally wasted!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;.getpart() is the method to iterate through the 'parts' of multipart shapes (which in my opinion are an abomination! I hate multipart shapes!!!). Maybe it's there for a good reason, but I don't have enough of your code to see.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 14:59:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226795#M7858</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-18T14:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226796#M7859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What I'm doing is receiving a bunch of road center-line files from a bunch of different agencies.&amp;nbsp; Their data dictionaries do not match ours (needless to say).&amp;nbsp; I create a new shapefile from a template that has our data dictionary, read the relevant fields from the agency, convert type, length, etc. if necessary, parse the street name fields and fill in the row.&amp;nbsp; I need their Shape field, so it's just natural to copy it in along with everything else.&amp;nbsp; I suppose I could copy their file, save the data, delete their fields (except for Shape), add in our fields, and continue from there.&amp;nbsp; But just to get around one instruction? ...which hopefully will start working soon?&amp;nbsp; Easier to go back to 9.3 if you ask me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; It looks to me like getPart( ) returns the entire array if no argument is given, or a specific part depending upon a numerical argument (where is the documentation on that?).&amp;nbsp; All I know is it worked in 9.3.1 SP2 but I have not had a chance to revisit it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I cannot see what SA will do for me.&amp;nbsp; Never looked at the python API for it.&amp;nbsp; I will check it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy &amp;amp; arcgisscripting together?&amp;nbsp; Ho!&amp;nbsp; You're kidding me!&amp;nbsp; How did you ever discover that?&amp;nbsp; I'm definitely going to try that.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; And, you are right about reviewing your code.&amp;nbsp; I'll have to quit doing that or start writing better comments.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I've only been on 10 for a couple of weeks or so.&amp;nbsp; It's great to get input from you guys that have been using it for a while. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y'all have a great holiday -- and thanks for the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Nov 2010 15:37:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226796#M7859</guid>
      <dc:creator>JohnSanders</dc:creator>
      <dc:date>2010-11-23T15:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226797#M7860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How bout just use the Append tool (with the field mapping object) to append their data into your template?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Nov 2010 16:49:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226797#M7860</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-23T16:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226798#M7861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just ran Append on one of my input files.&amp;nbsp; It only copied 477 out of 2592 features.&amp;nbsp; The ones it did all look correct.&amp;nbsp; Is there a log file for this?&amp;nbsp; It did not hit a bad geometry, this input has been checked for that.&amp;nbsp; There was no error message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Setting up the Field Map was tedious.&amp;nbsp; I have a little GUI that does that where everything is displayed at once and you can copy/paste from a list to text boxes.&amp;nbsp; It also does pretty good at guessing the matching fields.&amp;nbsp; At any rate, all the field maps have been pickled, so I just have to look for any changes that the agency might have made since the previous year.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My street name parser is integrated into my conversion script, the Label field is generated, and Zip, County, and City fields are generated from spatial matches on our respective databases.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just have to pick an agency folder, verify the field map, hit execute, and go do something else while it runs.&amp;nbsp; I'd be hard pressed to give up my script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to have 2 attribute tables viewable at the same time?&amp;nbsp; That's a weird change.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Nov 2010 19:26:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226798#M7861</guid>
      <dc:creator>JohnSanders</dc:creator>
      <dc:date>2010-11-23T19:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226799#M7862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am researching on data integration issues and use cases, especially in feature matching and conflation areas. It seems you are trying to unite multiple source centerlines with inconsistent attributes into one, which could be a challenging task, as you have already experienced. I wonder if your datasets cover similar areas or meet along the data borders and how the attribute situations are. Is it possible for you to send some sample data to me? My email address is &lt;/SPAN&gt;&lt;A href="mailto:dlee@esri.com"&gt;dlee@esri.com&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Nov 2010 16:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226799#M7862</guid>
      <dc:creator>DanLee</dc:creator>
      <dc:date>2010-11-24T16:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226800#M7863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In going back to 9.3.1, I've discovered that I may have created the insert cursor from a Table View instead of the shape file.&amp;nbsp; In 9.3.1, all fields, with the exception of the Shape field, will write with either the table-view derived cursor or a shape-file derived cursor.&amp;nbsp; In 9.3.1, Shape can only be written with an Insert Cursor that was derived from the shape-file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I suspect the problem in 10 may have only been a poor combination of using/not using .getPart( ) and the wrong Insert Cursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;None, some, or all of the above may be accurate.&amp;nbsp; There needs to be a "donkey" icon.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 12:24:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226800#M7863</guid>
      <dc:creator>JohnSanders</dc:creator>
      <dc:date>2010-12-02T12:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226801#M7864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ye gods, I was about to pipe in with my own similar problem, but with getValue.&amp;nbsp; I kept poking though, and found what the problem is.&amp;nbsp; Your suspicion of using a table view is probably correct, since the behavior that replicates that error is: running row.getValue(field) or row.setValue(field) when the given field doesn't exist in the row (e.g. SHAPE in a table view).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since my getValue is in a Python class I use for many purposes my solution was to wrap the getValue with an exception handler for a RuntimeError, making sure getValue was the only code in the try clause that would do throw one of those.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the original post's case, you'd want something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; Crow.setValue( 'Shape', arrayShape )
except RuntimeError:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # This means setValue failed, i.e. 'Shape' is not a valid field name in Crow.
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Put what you want script to do in this case here.
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jacob Blair&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:02:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226801#M7864</guid>
      <dc:creator>JacobBlair</dc:creator>
      <dc:date>2021-12-11T11:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226802#M7865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jacob,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for posting your experience with this problem.&amp;nbsp; You did not specifically say, but I'm assuming that you are on Arc10.&amp;nbsp; Your input is giving me the confidence to re-install 10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm going to use your suggestion of using the "try", "except".&amp;nbsp; I should be able to additionally trap bad geometries that way and not have to run a separate scan of the shapefile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John Sanders&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 14:52:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226802#M7865</guid>
      <dc:creator>JohnSanders</dc:creator>
      <dc:date>2010-12-20T14:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python, Arc10 - copy shape field contents from one table to another.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226803#M7866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Yes, I'm using v10 now.&amp;nbsp; A quick check with the legacy 9.3 'gp' shows that it will throw the RunTimeError in that situation as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jacob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 15:00:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-arc10-copy-shape-field-contents-from-one/m-p/226803#M7866</guid>
      <dc:creator>JacobBlair</dc:creator>
      <dc:date>2010-12-20T15:00:08Z</dc:date>
    </item>
  </channel>
</rss>

