I would like to launch a Command After the Export File Form Closes

I would like to launch a Command After the Export File Form Closes

MiguelVJC82W
Enthusiast Enthusiast
229 Views
1 Reply
Message 1 of 2

I would like to launch a Command After the Export File Form Closes

MiguelVJC82W
Enthusiast
Enthusiast

I have a custom button that launches the DXF Export window. I would like to be able to Launch another method after the Export window is closed. Currently my code opens the Export Form and then launches my other method, but I need the second method to process using information from the form. Is there a way to do this that I am just not seeing? 

 

using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using System;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.UI.Events;
using System.Windows.Forms;
using System.Xml.Linq;

 

namespace Ribbon
     {
      [Transaction(TransactionMode.Manual)]
      [Regeneration(RegenerationOption.Manual)]


      class CmdComboGroup : IExternalCommand
       {

          public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
            {


             CmdDFX2PDF n = new CmdDFX2PDF();
             n.Execute(commandData, ref message, elements);


             CmdCAD r = new CmdCAD();
             r.Execute(commandData, ref message, elements);

 

             return Result.Succeeded;

          }

    }
}

0 Likes
230 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

The standard Revit API approach to launch a command after the previous one has been completed is to use the Idling event:

 

 

However, there are other possibilities as well. For example, check out these recent discussions on similar topics:

   

    

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes