Example #1
0
        /// <summary>
        /// Startup
        /// </summary>
        /// <param name="application"></param>
        /// <returns></returns>
        public Result OnStartup(UIControlledApplication application)
        {
            RvtWindow = null; // no dialog needed yet; the command will bring it
            This      = this; // static access to this application instance

            return(Result.Succeeded);
        }
        /// <summary>
        /// Startup
        /// </summary>
        /// <param name="application"></param>
        /// <returns></returns>
        public Result OnStartup(UIControlledApplication application)
        {
            RvtWindow = null;   // no dialog needed yet; the command will bring it
              This = this;  // static access to this application instance

              return Result.Succeeded;
        }
Example #3
0
        /// <summary>
        /// The external command invokes this on the end-user's request
        /// </summary>
        /// <param name="uiapp"></param>
        public void ShowForm(UIApplication uiapp)
        {
            try
            {
                // If we do not have a dialog yet, create and show it
                if (RvtWindow != null)
                {
                    return;
                }

                // A new handler to handle request posting by the dialog
                var handler = new ExtEvntOpenView();

                // External Event for the dialog to use (to post requests)
                var extEvent = ExternalEvent.Create(handler);

                // We give the objects to the new dialog;
                // The dialog becomes the owner responsible for disposing them, eventually.
                RvtWindow = new RevitWindow(uiapp, extEvent, handler);
                RvtWindow.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #4
0
    /// <summary>
    /// The external command invokes this on the end-user's request 
    /// </summary>
    /// <param name="uiapp"></param>
    public void ShowForm(UIApplication uiapp)
    {

      // If we do not have a dialog yet, create and show it  
      if (RvtWindow != null) return;

      // A new handler to handle request posting by the dialog  
      ExtOpenView handler = new ExtOpenView();

      // External Event for the dialog to use (to post requests)  
      ExternalEvent m_event = ExternalEvent.Create(handler);

      // We give the objects to the new dialog;  
      // The dialog becomes the owner responsible for disposing them, eventually.
      RvtWindow = new RevitWindow(uiapp, m_event, handler);
      RvtWindow.Show();
    }
Example #5
0
        /// <summary>
        /// The external command invokes this on the end-user's request
        /// </summary>
        /// <param name="uiapp"></param>
        public void ShowForm(UIApplication uiapp)
        {
            // If we do not have a dialog yet, create and show it
            if (RvtWindow != null)
            {
                return;
            }

            // A new handler to handle request posting by the dialog
            ExtOpenView handler = new ExtOpenView();

            // External Event for the dialog to use (to post requests)
            ExternalEvent m_event = ExternalEvent.Create(handler);

            // We give the objects to the new dialog;
            // The dialog becomes the owner responsible for disposing them, eventually.
            RvtWindow = new RevitWindow(uiapp, m_event, handler);
            RvtWindow.Show();
        }
Example #6
0
    /// <summary>
    /// The external command invokes this on the end-user's request 
    /// </summary>
    /// <param name="uiapp"></param>
    public void ShowForm(UIApplication uiapp)
    {
      try
      {
        // If we do not have a dialog yet, create and show it  
        if (RvtWindow != null) return;

        // A new handler to handle request posting by the dialog  
        var handler = new ExtEvntOpenView();

        // External Event for the dialog to use (to post requests)  
        var extEvent = ExternalEvent.Create(handler);

        // We give the objects to the new dialog;  
        // The dialog becomes the owner responsible for disposing them, eventually.
        RvtWindow = new RevitWindow(uiapp, extEvent, handler);
        RvtWindow.Show();
      }
      catch (Exception ex)
      {
        MessageBox.Show(ex.ToString());
      }
    }