AnsweredAssumed Answered

Create point with mouse click

Question asked by 2Quik1 on Jul 23, 2015
Latest reply on Jul 24, 2015 by 2Quik1

I am attempting to learn python so please bare with me. I would like to create points with a mouse click. I have the following code from another post but it's not working i am getting the following error. at this point i would like to just create one point but after i get past this code i would like to be able to click anywhere and create multiple points. Can some one help me out with this code?

 

Traceback (most recent call last):

  File "C:\GIS\AddPoint.py", line 17, in <module>

    cursor.insertRow(row)

TypeError: sequence size must match size of the row

 

Failed to execute (Script).

 

#import modules  
import arcpy  

point = arcpy.GetParameterAsText(0)  #click
An = "AnimalPoints" #target point feature class Animal Sightings
  
for prow in arcpy.da.SearchCursor(point,'SHAPE@XY'):        
    x,y = prow[0]      
del prow  
   
point1 = arcpy.Point(x, y)  
ptGeometry = arcpy.PointGeometry(point1)

with arcpy.da.InsertCursor(An,('SHAPE@XY')) as cursor:
    cursor.insertRow(row)

Outcomes