IFailuresPreprocessor Interface |
An interface that may be used to perform a preprocessing step to either filter out anticipated transaction failures
or to mark certain failures as non-continuable.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic interface IFailuresPreprocessor
Public Interface IFailuresPreprocessor
public interface class IFailuresPreprocessor
type IFailuresPreprocessor = interface end
The IFailuresPreprocessor type exposes the following members.
Methods | Name | Description |
---|
 | PreprocessFailures |
This method is called when there have been failures found at the end of a transaction and Revit is about to start processing them.
|
Top
Remarks
This interface, if provided, is invoked when there are failures found at the end of a transaction.
An instance of this interface can be set in the failure handling options of transaction object.
Examplepublic class RoomWarningSwallower : IFailuresPreprocessor
{
public FailureProcessingResult PreprocessFailures(FailuresAccessor failuresAccessor)
{
IList<FailureMessageAccessor> failList = new List<FailureMessageAccessor>();
failList = failuresAccessor.GetFailureMessages();
foreach (FailureMessageAccessor failure in failList)
{
FailureDefinitionId failID = failure.GetFailureDefinitionId();
if (failID == BuiltInFailures.RoomFailures.RoomNotEnclosed)
{
failuresAccessor.DeleteWarning(failure);
}
}
return FailureProcessingResult.Continue;
}
}
Public Class RoomWarningSwallower
Implements IFailuresPreprocessor
Public Function PreprocessFailures(failuresAccessor As FailuresAccessor) As FailureProcessingResult Implements IFailuresPreprocessor.PreprocessFailures
Dim failList As IList(Of FailureMessageAccessor) = New List(Of FailureMessageAccessor)()
failList = failuresAccessor.GetFailureMessages()
For Each failure As FailureMessageAccessor In failList
Dim failID As FailureDefinitionId = failure.GetFailureDefinitionId()
If failID = BuiltInFailures.RoomFailures.RoomNotEnclosed Then
failuresAccessor.DeleteWarning(failure)
End If
Next
Return FailureProcessingResult.[Continue]
End Function
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also