Can somebody tell me how to create a line geometry by mouse click with python addin?
I am using below code in python addin tool.
class ToolClass8(object):
"""Implementation for Testmsg_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor = 3
self.shape = "Line"
def onLine(self, line_geometry):
NewL = "NewL"
cur = arcpy.da.InsertCursor(NewL, ["SHAPE@"])
array = arcpy.Array()
part = line_geometry.getPart(0)
for pt in part:
array.add(pt)
cur.insertRow(arcpy.Polyline(array))
which throws the error:
cur.insertRow(arcpy.Polyline(array)) TypeError: argument must be sequence of values
Can somebody help me with the code?