PerformanceAdviser Class

The tool to report performance problems in a given document.
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.DBPerformanceAdviser

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class PerformanceAdviser : IDisposable

The PerformanceAdviser type exposes the following members.

Properties
 NameDescription
Public propertyIsValidObject Specifies whether the .NET object represents a valid Revit entity.
Top
Methods
 NameDescription
Public methodAddRule Adds a performance adviser rule to the list of rules.
Public methodDeleteRule Deletes a performance adviser rule from the list of rules.
Public methodDisposeReleases all resources used by the PerformanceAdviser
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodExecuteAllRules Executes all rules in the list on a given document.
Public methodExecuteRules(Document, IListPerformanceAdviserRuleId) Executes selected rules on a given document.
Public methodExecuteRules(Document, IListInt32) Executes selected rules on a given document.
Public methodGetAllRuleIds Retrieves an enumeration of rule Ids.
Public methodGetElementFilterFromRule(Int32, Document) Retrieves a filter to restrict elements to be checked.
Public methodGetElementFilterFromRule(PerformanceAdviserRuleId, Document) Retrieves a filter to restrict elements to be checked.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetNumberOfRules Retrieves number of performance adviser rules in the list.
Public methodStatic memberGetPerformanceAdviser Returns the only instance of PerformanceAdviser in the Application.
Public methodGetRuleDescription(Int32) Retrieves the description of the rule.
Public methodGetRuleDescription(PerformanceAdviserRuleId) Retrieves the description of the rule.
Public methodGetRuleId Retrieves an id of a rule for a given index in the list.
Public methodGetRuleName(Int32) Retrieves the name of the rule.
Public methodGetRuleName(PerformanceAdviserRuleId) Retrieves the name of the rule.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIsRuleEnabled(Int32) Retrieves an enabled/disabled status for the given rule.
Public methodIsRuleEnabled(PerformanceAdviserRuleId) Retrieves an enabled/disabled status for the given rule.
Public methodPostWarning Reports a problem detected during execution of a rule.
Public methodSetRuleEnabled(Int32, Boolean) Retrieves an enabled/disabled status for the given rule.
Public methodSetRuleEnabled(PerformanceAdviserRuleId, Boolean) Retrieves an enabled/disabled status for the given rule.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodWillRuleCheckElements(Int32) Reports if rule needs to be executed on individual elements.
Public methodWillRuleCheckElements(PerformanceAdviserRuleId) Reports if rule needs to be executed on individual elements.
Top
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.
Example
//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);
See Also