AnsweredAssumed Answered

Update cursor and SHAPE@XY token problem

Question asked by Panagiotis on May 11, 2015
Latest reply on May 12, 2015 by Panagiotis

Hello everyone,

 

I am new to Python and ArcPy.

I am testing the script below which is running for a point feaure class, but not for a line feature class.

 

  1. import arcpy
  2. arcpy.env.workspace = r"D:\Student\PYTH\6_Geometry_objects\SanDiego.gdb"
  3. # Variables
  4. featClass = "MajorAttractions2"
  5. fields = ["SHAPE@XY"]
  6. exp = "OBJECTID = 4"
  7. pnt = arcpy.Point()
  8. pnt.X = 306400
  9. pnt.Y = 4098400
  10. with arcpy.da.UpdateCursor(featClass, fields, exp) as cur:
  11.     for row in cur:
  12.         row[0] = pnt
  13.         cur.updateRow(row)
  14. print "Script completed"

 

In the latter case, I am getting the following error message: "exceptions.SystemError: error return without exception set" for line 16.

 

Thank you in advance,

Panagiotis

Outcomes