2021 Class
Changes 0
C

PerformanceAdviser

Description:
The tool to report performance problems in a given document.
Remarks:
Class is an application-wide singleton that performs a dual role: it is a repository of rules to run in order to detect potential performance problems as well as an access point to execute checks.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.PerformanceAdviser
public class PerformanceAdviser : IDisposable
//Get the name of each registered PerformanceRule and then execute all of them.
foreach (PerformanceAdviserRuleId id in PerformanceAdviser.GetPerformanceAdviser().GetAllRuleIds())
{
    string ruleName = PerformanceAdviser.GetPerformanceAdviser().GetRuleName(id);
}
PerformanceAdviser.GetPerformanceAdviser().ExecuteAllRules(document);
Name Return Type Description
M AddRule(PerformanceAdviserRuleId, IPerformanceAdviserRule) None Adds a performance adviser rule to the list of rules.
M DeleteRule(PerformanceAdviserRuleId) None Deletes a performance adviser rule from the list of rules.
M Dispose() None Releases all resources used by the
M ExecuteAllRules(Document) IList<FailureMessage> Executes all rules in the list on a given document.
M ExecuteRules(Document, IList<Int32>) IList<FailureMessage> Executes selected rules on a given document.
M ExecuteRules(Document, IList<PerformanceAdviserRuleId>) IList<FailureMessage> Executes selected rules on a given document.
M GetAllRuleIds() IList<PerformanceAdviserRuleId> Retrieves an enumeration of rule Ids.
M GetElementFilterFromRule(Int32, Document) ElementFilter Retrieves a filter to restrict elements to be checked.
M GetElementFilterFromRule(PerformanceAdviserRuleId, Document) ElementFilter Retrieves a filter to restrict elements to be checked.
M GetNumberOfRules() int Retrieves number of performance adviser rules in the list.
M GetPerformanceAdviser() PerformanceAdviser Returns the only instance of PerformanceAdviser in the Application.
M GetRuleDescription(Int32) string Retrieves the description of the rule.
M GetRuleDescription(PerformanceAdviserRuleId) string Retrieves the description of the rule.
M GetRuleId(Int32) The rule id. Retrieves an id of a rule for a given index in the list.
M GetRuleName(Int32) string Retrieves the name of the rule.
M GetRuleName(PerformanceAdviserRuleId) string Retrieves the name of the rule.
M IsRuleEnabled(Int32) bool Retrieves an enabled/disabled status for the given rule.
M IsRuleEnabled(PerformanceAdviserRuleId) bool Retrieves an enabled/disabled status for the given rule.
M PostWarning(FailureMessage) None Reports a problem detected during execution of a rule.
M SetRuleEnabled(Int32, Boolean) None Retrieves an enabled/disabled status for the given rule.
M SetRuleEnabled(PerformanceAdviserRuleId, Boolean) None Retrieves an enabled/disabled status for the given rule.
M WillRuleCheckElements(Int32) bool Reports if rule needs to be executed on individual elements.
M WillRuleCheckElements(PerformanceAdviserRuleId) bool Reports if rule needs to be executed on individual elements.
Name Return Type Description
P IsValidObject bool Specifies whether the .NET object represents a valid Revit entity.