Class consists of delegate methods of DocumentSaving/SavingAs and DocumentClosing events. These delegates will be raised once document is about to be saved or closed. But, delegate will update mapped spreadsheet only when user created rooms for current document. (That's, user clicks the button "Create Unplaced Rooms" and new rooms was created successfully). Otherwise, these events handler methods won't do any update even if they were raised.
Inheritance: IDisposable
Exemplo n.º 1
0
        /// <summary>
        /// Implement OnStartup method to subscribe related events.
        /// </summary>
        /// <param name="application">Current loaded application.</param>
        /// <returns></returns>
        public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application)
        {
            // specify the log
            string assemblyName = this.GetType().Assembly.Location;

            m_eventReactor = new EventsReactor(assemblyName.Replace(".dll", ".log"));
            //
            // subscribe events
            application.ControlledApplication.DocumentSaving   += new EventHandler <Autodesk.Revit.DB.Events.DocumentSavingEventArgs>(EventReactor.DocumentSaving);
            application.ControlledApplication.DocumentSavingAs += new EventHandler <Autodesk.Revit.DB.Events.DocumentSavingAsEventArgs>(EventReactor.DocumentSavingAs);
            application.ControlledApplication.DocumentClosed   += new EventHandler <Autodesk.Revit.DB.Events.DocumentClosedEventArgs>(EventReactor.DocumentClosed);
            return(Autodesk.Revit.UI.Result.Succeeded);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Implement OnStartup method to subscribe related events.
 /// </summary>
 /// <param name="application">Current loaded application.</param>
 /// <returns></returns>
 public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application)
 {
     // specify the log
     string assemblyName = this.GetType().Assembly.Location;
     m_eventReactor = new EventsReactor(assemblyName.Replace(".dll", ".log"));
     //
     // subscribe events
     application.ControlledApplication.DocumentSaving += new EventHandler<Autodesk.Revit.DB.Events.DocumentSavingEventArgs>(EventReactor.DocumentSaving);
     application.ControlledApplication.DocumentSavingAs += new EventHandler<Autodesk.Revit.DB.Events.DocumentSavingAsEventArgs>(EventReactor.DocumentSavingAs);
     application.ControlledApplication.DocumentClosed += new EventHandler<Autodesk.Revit.DB.Events.DocumentClosedEventArgs>(EventReactor.DocumentClosed);
     return Autodesk.Revit.UI.Result.Succeeded;
 }