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 |
|---|---|---|
| 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 |
| ExecuteAllRules(Document) | IList<FailureMessage> | Executes all rules in the list on a given document. |
| ExecuteRules(Document, IList<Int32>) | IList<FailureMessage> | Executes selected rules on a given document. |
| ExecuteRules(Document, IList<PerformanceAdviserRuleId>) | 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. |
| GetNumberOfRules() | int | 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) | The rule id. | 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. |
| IsRuleEnabled(Int32) | bool | Retrieves an enabled/disabled status for the given rule. |
| IsRuleEnabled(PerformanceAdviserRuleId) | bool | 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. |
| WillRuleCheckElements(Int32) | bool | Reports if rule needs to be executed on individual elements. |
| WillRuleCheckElements(PerformanceAdviserRuleId) | bool | Reports if rule needs to be executed on individual elements. |
| Name | Return Type | Description |
|---|---|---|
| IsValidObject | bool | Specifies whether the .NET object represents a valid Revit entity. |