Skip to content

PerformanceAdviser

Public Class

The tool to report performance problems in a given document.

Inheritance Hierarchy

System.Object
Autodesk.Revit.DB.PerformanceAdviser

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

Name

Description


Public Property
IsValidObject

Specifies whether the .NET object represents a valid Revit entity.


Methods

Name

Description


Public Method

Adds a performance adviser rule to the list of rules.


Public Method

Deletes a performance adviser rule from the list of rules.


Public Method

Releases all resources used by the PerformanceAdviser


Public Method

Equals

Determines whether the specified object is equal to the current object.
(Inherited from Object)


Public Method
ExecuteAllRules

Executes all rules in the list on a given document.


Public Method

Executes selected rules on a given document.


Public Method
ExecuteRules(Document, IList.Int32.)

Executes selected rules on a given document.


Public Method

Retrieves an enumeration of rule Ids.


Public Method

Retrieves a filter to restrict elements to be checked.


Public Method

Retrieves a filter to restrict elements to be checked.


Public Method

GetHashCode

Serves as the default hash function.
(Inherited from Object)


Public Method

Retrieves number of performance adviser rules in the list.


Public Method
Static Member

Returns the only instance of PerformanceAdviser in the Application.


Public Method

Retrieves the description of the rule.


Public Method

Retrieves the description of the rule.


Public Method

Retrieves an id of a rule for a given index in the list.


Public Method

Retrieves the name of the rule.


Public Method

Retrieves the name of the rule.


Public Method

GetType

Gets the Type of the current instance.
(Inherited from Object)


Public Method

Retrieves an enabled/disabled status for the given rule.


Public Method

Retrieves an enabled/disabled status for the given rule.


Public Method

Reports a problem detected during execution of a rule.


Public Method

Retrieves an enabled/disabled status for the given rule.


Public Method

Retrieves an enabled/disabled status for the given rule.


Public Method

ToString

Returns a string that represents the current object.
(Inherited from Object)


Public Method

Reports if rule needs to be executed on individual elements.


Public Method

Reports if rule needs to be executed on individual elements.


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);