Autodesk.Revit.DB.BuiltInFailures.RenderFailures
枚举类型定义了Revit中与渲染相关的错误和失败类型。
BackgroundAccessError
:无法访问背景颜色数据导致的失败。BackgroundSaveError
:保存背景颜色数据失败。ColorSchemeNotValid
:颜色方案无效。GraphicsSystemFailure
:渲染图形系统出现错误。HiddenLineViewsNotSupported
:遮挡视图不受支持。InvalidViewData
:视图数据无效,无法渲染。LightingSystemFailure
:渲染照明系统出现错误。MaterialNotFound
:材质未找到,无法渲染。MaterialSystemFailure
:渲染材质系统出现错误。MissingTextureFound
:找到缺失的纹理文件。NonPlanarFacesNotAllowed
:存在无法处理的非平面面。OutOfMemoryError
:内存不足。RenderSuspended
:渲染暂停,无法继续。TextureFileNotFound
:无法找到纹理文件。可以使用Autodesk.Revit.DB.FailureDefinition
类的AddFailures
方法将这些渲染失败添加到Revit的失败管理中。
FailureDefinitionId backgroundAccessErrorId = new FailureDefinitionId(BuiltInFailures.RenderFailures.BackgroundAccessError);
FailureDefinitionId backgroundSaveErrorId = new FailureDefinitionId(BuiltInFailures.RenderFailures.BackgroundSaveError);
FailureDefinitionId graphicsSystemFailureId = new FailureDefinitionId(BuiltInFailures.RenderFailures.GraphicsSystemFailure);
FailureDefinition backgroundAccessError = FailureDefinition.Create(backgroundAccessErrorId, FailureSeverity.Warning, "无法访问背景色数据.");
FailureDefinition backgroundSaveError = FailureDefinition.Create(backgroundSaveErrorId, FailureSeverity.Warning, "保存背景色数据失败.");
FailureDefinition graphicsSystemFailure = FailureDefinition.Create(graphicsSystemFailureId, FailureSeverity.Warning, "渲染图形系统出现错误.");
// 添加到失败管理器
FailureDefinitionRegistry failureRegistry = FailureDefinitionRegistry.Current;
failureRegistry.RegisterFailureDefinition(backgroundAccessError);
failureRegistry.RegisterFailureDefinition(backgroundSaveError);
failureRegistry.RegisterFailureDefinition(graphicsSystemFailure);