Autodesk.Revit.DB.Visual.Checker is a class in the Autodesk Revit API that is responsible for checking the visual representation of elements in the Revit model. It provides functionality to validate the graphics of the elements to ensure that they are displayed correctly in the user interface.
Autodesk.Revit.DB.Visual.Checker is a subclass of the Autodesk.Revit.DB.ElementChecker class. It provides additional methods and properties for checking the visual representation of elements. The following table lists the important properties and methods of the Visual Checker class:
Properties | Description |
---|---|
CheckGraphicsCall | Gets or sets a delegate to a method that is called to perform the visual check on an element. |
Element | Gets the element being checked. |
Result | Gets the result of the visual check for the element. |
Methods | Description |
---|---|
Check() | Performs the visual check on the element. This method throws an exception if the visual check fails. |
CheckWithoutThrowing() | Performs the visual check on the element without throwing an exception if the check fails. |
The Visual Checker class can be used to ensure that the visual representation of elements in the Revit model is correct. This is particularly useful when developing custom Revit add-ins that modify the graphics or geometry of the elements.
The following code example demonstrates how to use the Visual Checker to check the visual representation of a selected element in the Revit model:
// Get the UI document
UIDocument uiDoc = commandData.Application.ActiveUIDocument;
// Get the selected element
Element element = uiDoc.Selection.GetElement();
// Create a new Visual Checker for the element
VisualChecker visualChecker = new VisualChecker(element);
// Perform the visual check
visualChecker.Check();
In the above example, the Check() method is called to perform the visual check on the selected element. If the check fails, an exception is thrown. The CheckWithoutThrowing() method can also be used to perform the check without throwing an exception.
Autodesk.Revit.DB.Visual.Checker is a useful class in the Autodesk Revit API for checking the visual representation of elements in the Revit model. It provides functionality for validating the graphics of the elements to ensure that they are displayed correctly in the user interface. By using the Visual Checker, developers can ensure that their custom Revit add-ins modify the graphics or geometry of the elements correctly.