Blog

Open ArcTool Script using ArcObject.

Posted by Yogesh Sharma Blogs | ArcObject Dec 07, 2012
Open ArcTool Script using ArcObject.
Open ArcTool Script using ArcObject.

public override void OnClick()
        {
            UID puid = new UIDClass();
            puid.Value = "esriGeoprocessingUI.ArcToolboxExtension";

            IArcToolboxExtension pArcToolboxExt;

            pArcToolboxExt = (IArcToolboxExtension)m_application.FindExtensionByCLSID(puid);
            IArcToolbox pArcToolBox = pArcToolboxExt.ArcToolbox;

            try
            {
                IGPTool pTol = pArcToolBox.GetToolbyNameString("ScriptGeotechnicalParameterMaps");
                IGPToolCommandHelper comhelp = new GPToolCommandHelperClass();
                comhelp.SetTool(pTol);
                comhelp.Invoke(null);
                m_application.CurrentTool = null;
            }
            catch(Exception ex)
            {
                MessageBox.Show("Model/script Not present in ToolBox.");
                m_application.CurrentTool = null;
            }
            // TODO: Add ToolWaterLevelMaps.OnClick implementation
            // TODO: Add ToolGeotechnicalParameterMaps.OnClick implementation
        }

COMMENT USING
PREMIUM SPONSORS
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
Employers - Post Free Jobs
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.