C# Class Revit.SDK.Samples.PerformanceAdviserControl.CS.FlippedDoorCheck

A class that implements IPerformanceAdviserRule. This class implements several methods that will be run automatically when PerformanceAdviser::ExecuteRules or ExecuteAllRules is called.
Inheritance: Autodesk.Revit.DB.IPerformanceAdviserRule
Mostra file Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
ExecuteElementCheck ( Autodesk document, Autodesk element ) : void

This method does most of the work of the IPerformanceAdviserRule implementation. It is called by PerformanceAdviser. It examines the element passed to it (which was previously filtered by the filter returned by GetElementFilter() (see below)). After checking to make sure that the element is an instance, it checks the FacingFlipped property of the element. If it is flipped, it adds the instance to a list to be used later.

FinalizeCheck ( Autodesk document ) : void

This method is called by PerformanceAdviser after all elements in document matching the ElementFilter from GetElementFilter() are checked by ExecuteElementCheck(). This method checks to see if there are any elements (door instances, in this case) in the m_FlippedDoor instance member. If there are, it iterates through that list and displays the instance name and door tag of each item.

FlippedDoorCheck ( ) : System

Set up rule name, description, and error handling

GetDescription ( ) : string

Gets the description of the rule

GetElementFilter ( Autodesk document ) : Autodesk.Revit.DB.ElementFilter

This method supplies an element filter to reduce the number of elements that PerformanceAdviser will pass to GetElementCheck(). In this case, we are filtering for door elements.

GetName ( ) : string

Gets the name of the rule

InitCheck ( Autodesk document ) : void

Does some preliminary work before executing tests on elements. In this case, we instantiate a list of FamilyInstances representing all doors that are flipped.

WillCheckElements ( ) : bool

Returns true if this rule will iterate through elements and check them, false otherwise

getRuleId ( ) : Autodesk.Revit.DB.PerformanceAdviserRuleId

This method is used by PerformanceAdviser to get the ID of the rule. It returns a global static field to make sharing the ID in different places in the application easier.

Method Details

ExecuteElementCheck() public method

This method does most of the work of the IPerformanceAdviserRule implementation. It is called by PerformanceAdviser. It examines the element passed to it (which was previously filtered by the filter returned by GetElementFilter() (see below)). After checking to make sure that the element is an instance, it checks the FacingFlipped property of the element. If it is flipped, it adds the instance to a list to be used later.
public ExecuteElementCheck ( Autodesk document, Autodesk element ) : void
document Autodesk The active document
element Autodesk The current element being checked
return void

FinalizeCheck() public method

This method is called by PerformanceAdviser after all elements in document matching the ElementFilter from GetElementFilter() are checked by ExecuteElementCheck(). This method checks to see if there are any elements (door instances, in this case) in the m_FlippedDoor instance member. If there are, it iterates through that list and displays the instance name and door tag of each item.
public FinalizeCheck ( Autodesk document ) : void
document Autodesk The active document
return void

FlippedDoorCheck() public method

Set up rule name, description, and error handling
public FlippedDoorCheck ( ) : System
return System

GetDescription() public method

Gets the description of the rule
public GetDescription ( ) : string
return string

GetElementFilter() public method

This method supplies an element filter to reduce the number of elements that PerformanceAdviser will pass to GetElementCheck(). In this case, we are filtering for door elements.
public GetElementFilter ( Autodesk document ) : Autodesk.Revit.DB.ElementFilter
document Autodesk The document being checked
return Autodesk.Revit.DB.ElementFilter

GetName() public method

Gets the name of the rule
public GetName ( ) : string
return string

InitCheck() public method

Does some preliminary work before executing tests on elements. In this case, we instantiate a list of FamilyInstances representing all doors that are flipped.
public InitCheck ( Autodesk document ) : void
document Autodesk The document being checked
return void

WillCheckElements() public method

Returns true if this rule will iterate through elements and check them, false otherwise
public WillCheckElements ( ) : bool
return bool

getRuleId() public method

This method is used by PerformanceAdviser to get the ID of the rule. It returns a global static field to make sharing the ID in different places in the application easier.
public getRuleId ( ) : Autodesk.Revit.DB.PerformanceAdviserRuleId
return Autodesk.Revit.DB.PerformanceAdviserRuleId