Exemple #1
0
        /// <summary>
        /// This method is called by PerformanceAdviser after all elements in document
        /// matching the ElementFilter from GetElementFilter() are checked by ExecuteElementCheck().
        /// 
        /// This method checks to see if there are any elements (door instances, in this case) in the
        /// m_FlippedDoor instance member.  If there are, it iterates through that list and displays
        /// the instance name and door tag of each item.
        /// </summary>
        /// <param name="document">The active document</param>
        public void FinalizeCheck(Autodesk.Revit.DB.Document document)
        {
            if (m_FlippedDoors.Count == 0)
              System.Diagnostics.Debug.WriteLine("No doors were flipped.  Test passed.");

               else
               {
              //Pass the element IDs of the flipped doors to the revit failure reporting APIs.
              Autodesk.Revit.DB.FailureMessage fm = new Autodesk.Revit.DB.FailureMessage(m_doorWarningId);
              fm.SetFailingElements(m_FlippedDoors);
              Autodesk.Revit.DB.Transaction failureReportingTransaction = new Autodesk.Revit.DB.Transaction(document, "Failure reporting transaction");
              failureReportingTransaction.Start();
               document.PostFailure(fm);
              failureReportingTransaction.Commit();
              m_FlippedDoors.Clear();
               }
        }