2

I simply want to open the custom model's SCREEN (ModelBuilder) from .NET.

1
  • Tags modified to better reflect the question. Commented Sep 28, 2010 at 21:58

1 Answer 1

5

When your command is run inside ArcMap (should work in ArcCatalog and other applications as well):

 var arcToolBoxExtension = _app.FindExtensionByName("ESRI ArcToolbox") as IArcToolboxExtension; if (arcToolBoxExtension != null) { var arcToolBox = arcToolBoxExtension.ArcToolbox; var gpTool = arcToolBox.GetToolbyNameString("MyModelName"); if (gpTool != null) arcToolBox.EditToolSource(gpTool); } 

Where _app is an IApplication reference, and "MyModelName" is the Name of your model. Note that the Name is different from the model's Label - you can find both in the tool's properties on the General tab as shown below:

alt text

3
  • Thank you. Thank you. Thank you. Works perfectly! Just what I need. Commented Sep 28, 2010 at 16:53
  • Sorry for being a nitwit. But, where do I click to mark this as answered? :) Commented Sep 28, 2010 at 17:49
  • I suggest you skim over FAQ gis.stackexchange.com/faq to get to know how the site works, it will help you understand asking/answering questions and other things, like reputation, which you will find useful. Commented Sep 28, 2010 at 21:57