access measure tool for python add in

371
2
10-10-2012 10:23 AM
bogdanpalade1
New Contributor III
Hello,

I would like to make a python Add In that would be a toolbar containing one "measure" button among other stuff. Can you please tell me how is the implementation of the onClick method to measure things in ArcMap interface?

I looked it up in the internet and esri help files but I always find the same examples, i.e. zoom to selected feature or extract by some extent. Nothing on measure tool.

Thank you a lot
Tags (2)
0 Kudos
2 Replies
JasonScheirer
Occasional Contributor III
You'd probably want to implement a tool with the onLine method defined, not a simple button. So something like this:

class MyTool(object):
   def __init__(self):
        self.shape = 'Line'
   def onLine(self, line_object):
        line_length = line_object.length
        # do something with line_length
0 Kudos
bogdanpalade1
New Contributor III
Thank you very much Jason!
0 Kudos