Autodesk.Revit.DB.DocumentValidation is a namespace in the Revit API that provides classes for validating Revit document contents. These classes can help identify potential errors or inconsistencies in the Revit document and allow for correcting them before they become problematic.
DocumentValidator is the main class in the Autodesk.Revit.DB.DocumentValidation namespace, which provides methods for validating Revit documents. These methods include:
ValidationResult is a class that represents the result of a validation operation on a Revit document. It contains a list of ValidationErrors that were found during the validation process.
ValidationError represents an error that was found during the validation of a Revit document. It contains information about the error, including the severity, category, and message.
To use Autodesk.Revit.DB.DocumentValidation, you need to add a reference to the RevitAPI.dll assembly in your project. You can then create an instance of the DocumentValidator class and use its methods to validate the Revit document.
var validator = new DocumentValidator(document);
var validationResult = validator.Validate();
foreach (var error in validationResult.Errors)
{
Console.WriteLine(error.Message);
}
The Autodesk.Revit.DB.DocumentValidation namespace provides classes for validating Revit documents, which can help avoid potential errors or inconsistencies in the document. The DocumentValidator class provides methods for validating the entire document or specific parts of it, and the ValidationResult and ValidationError classes provide information about the errors found during the validation process.