Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
    
Tags modified to better reflect the question. –  Petr Krebs Sep 28 '10 at 21:58
    
Thank you so much!!! i did it!thanks!!! –  user17493 Apr 24 '13 at 10:21
add comment

1 Answer 1

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

share|improve this answer
    
Thank you. Thank you. Thank you. Works perfectly! Just what I need. –  deskcheck1 Sep 28 '10 at 16:53
    
Sorry for being a nitwit. But, where do I click to mark this as answered? :) –  deskcheck1 Sep 28 '10 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. –  Petr Krebs Sep 28 '10 at 21:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.