PerformanceAdviser
Description:
The tool to report performance problems in a given document.
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.
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
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 | Inherited From |
|---|---|---|---|
| AddRule(PerformanceAdviserRuleId, IPerformanceAdviserRule) | None | Adds a performance adviser rule to the list of rules. | |
| DeleteRule(PerformanceAdviserRuleId) | None | Deletes a performance adviser rule from the list of rules. | |
| Dispose() | None | Releases all resources used by the PerformanceAdviser | |
| Equals | None | Determines whether the specified object is equal to the current object. (Inherited from Object ) | Object |
| ExecuteAllRules(Document) | IList<FailureMessage> | Executes all rules in the list on a given document. | |
| ExecuteRules(Document, IList<PerformanceAdviserRuleId>) | IList<FailureMessage> | Executes selected rules on a given document. | |
| ExecuteRules(Document, IList<Int32>) | IList<FailureMessage> | Executes selected rules on a given document. | |
| GetAllRuleIds() | IList<PerformanceAdviserRuleId> | Retrieves an enumeration of rule Ids. | |
| GetElementFilterFromRule(Int32, Document) | ElementFilter | Retrieves a filter to restrict elements to be checked. | |
| GetElementFilterFromRule(PerformanceAdviserRuleId, Document) | ElementFilter | Retrieves a filter to restrict elements to be checked. | |
| GetHashCode | None | Serves as the default hash function. (Inherited from Object ) | Object |
| GetNumberOfRules() | Int32 | Retrieves number of performance adviser rules in the list. | |
| GetPerformanceAdviser() | PerformanceAdviser | Returns the only instance of PerformanceAdviser in the Application. | |
| GetRuleDescription(Int32) | String | Retrieves the description of the rule. | |
| GetRuleDescription(PerformanceAdviserRuleId) | String | Retrieves the description of the rule. | |
| GetRuleId(Int32) | PerformanceAdviserRuleId | Retrieves an id of a rule for a given index in the list. | |
| GetRuleName(Int32) | String | Retrieves the name of the rule. | |
| GetRuleName(PerformanceAdviserRuleId) | String | Retrieves the name of the rule. | |
| GetType | None | Gets the Type of the current instance. (Inherited from Object ) | Object |
| IsRuleEnabled(Int32) | Boolean | Retrieves an enabled/disabled status for the given rule. | |
| IsRuleEnabled(PerformanceAdviserRuleId) | Boolean | Retrieves an enabled/disabled status for the given rule. | |
| PostWarning(FailureMessage) | None | Reports a problem detected during execution of a rule. | |
| SetRuleEnabled(Int32, Boolean) | None | Retrieves an enabled/disabled status for the given rule. | |
| SetRuleEnabled(PerformanceAdviserRuleId, Boolean) | None | Retrieves an enabled/disabled status for the given rule. | |
| ToString | None | Returns a string that represents the current object. (Inherited from Object ) | Object |
| WillRuleCheckElements(Int32) | Boolean | Reports if rule needs to be executed on individual elements. | |
| WillRuleCheckElements(PerformanceAdviserRuleId) | Boolean | Reports if rule needs to be executed on individual elements. |
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| IsValidObject | Boolean | Specifies whether the .NET object represents a valid Revit entity. |