AnsweredAssumed Answered

Arcpy write geometry error

Question asked by DEVAPPGIS on Feb 16, 2017
Latest reply on Jul 12, 2017 by bixb0012

Hi guys,

i have develop a python script that use the cursor to read the geometry by one FC and write this geometry into temporal layer create by Make Route Event Layer.

The FC where i read geometry is a Multipoint and also my temporal layer is Multipoint. I have write this code:

 

field_1 = ["ID"]
field_2 = ["SHAPE@","SHAPE@X","SHAPE@Y","ID","SHAPE@XY"]

for row in arcpy.da.SearchCursor("tab_loc_lyr", field_1):
    where = "ID = '" + str(row[0])+"'"
    select = arcpy.SelectLayerByAttribute_management("loc", "NEW_SELECTION", where)
    for row_ in arcpy.da.SearchCursor(select, field_2):
        icur = arcpy.InsertCursor("event_lyr")
        irow = icur.newRow()
        irow.Shape = row_[0]
        irow.ID = row_[3]
        icur.insertRow(irow)

 

if i try the code without insert geometry works finie but if i try also to write the geometry with:

 

irow.Shape = row_[0]

 

i recive this error:

 

irow.Shape = row_[0]
  File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\arcobjects\_base.py", line 35, in __setattr__
    return setattr(self._arc_object, attr, ao)
RuntimeError: ERROR 999999: Error executing function.

 

Any hep please???

Thanks

Outcomes