AnsweredAssumed Answered

How do I get the instance of a MapTool?

Question asked by htudosieesri-ca-esridist Employee on Jul 19, 2016
Latest reply on Oct 18, 2017 by popalzay

I don't want to get a wrapper command (with GetPlugInWrapper.)

I just need to access some methods that I have defined in my inherited Tool class definition.

(I Think that I can identify the tool instance by its ID since I have just one instance (?))

 

internal class PickupTool : MapTool
    {
        /// <summary>
        /// Define the tool as a sketch tool that draws a rectangle in screen space on the view.
        /// </summary>
        public PickupTool()
        {
            IsSketchTool = true;
            SetSketchType(Settings.Default.GfxPickOption);
            UseSnapping = true;
            SketchOutputMode = SketchOutputMode.Screen;
        }

       public void SetSketchType(PickToolOptions gfxPickOption)
        {
            switch (gfxPickOption)
            {
                case PickToolOptions.Point:
                    SketchType = SketchGeometryType.Point;
                    Cursor = GetCursor("PointCursor.cur");
                    break;
...

 

From a ribbon button/menu I need to call the method in line 14.

Outcomes