当前位置:网站首页>Revit secondary development - shielding warning prompt window
Revit secondary development - shielding warning prompt window
2022-07-07 22:22:00 【Hey, hey, hey, hey, hey】
Happy new year to you all , Good luck in the year of the ox , Pay doubled !
Implementation interface
public class FailurePreprocessor : IFailuresPreprocessor
{
private string _failureMessage;
public string FailureMessage
{
get{return _failureMessage;}
set{_failureMessage=value;}
}
private bool _error;
public bool HasError
{
get{return _error;}
set{_error = value;}
}
public FailureProcessingResult PreprocessFailures(FailuresAccessor fa)
{
IList<FailureMessageAccessor> lstFma = fa.GetFailureMessages();
if(lstFma.Count() == 0) return FailureProcessingResult.Continue;
foreach(FailureMessageAccessor item in lstFma)
{
if(item.GetSeverity() == FailureSeverity.Warning)
{
_error = false;
fa.DeleteWarning(item);
}
else if(item.GetSeverity() == FailureSeverity.Error)
{
if(item.HasResolutions())
{
fa.ResolveFailure(item);
_failureMessage = fa.GetDescriptionText();
_error = true;
return FailureProcessingResult.ProceedWithRollBack;
}
}
}
return FailureProcessingResult.Continue;
}
}call
using(Transcation trans = new Transcation(doc,"hey"))
{
FailureHandlingOptions fho = trans.GetFailureHandlingOptions();
fho.SetFailuresPreprocessor(new FailuresPreprocessor());
trans.SetFailureHandlingOptions(fho);
trans.Start();
//
//
//
trans.Commit();
}边栏推荐
- Build your own website (18)
- Crawler (17) - Interview (2) | crawler interview question bank
- TCP/IP 协议栈
- DBSync新增对MongoDB、ES的支持
- MIT6.S081-Lab9 FS [2021Fall]
- OpenGL homework - Hello, triangle
- DNS series (I): why does the updated DNS record not take effect?
- ByteDance senior engineer interview, easy to get started, fluent
- 如何选择合适的自动化测试工具?
- JS number is insufficient, and 0 is added
猜你喜欢

NVR硬盤錄像機通過國標GB28181協議接入EasyCVR,設備通道信息不顯示是什麼原因?

【Azure微服务 Service Fabric 】如何转移Service Fabric集群中的种子节点(Seed Node)

PDF文档签名指南

2022 how to evaluate and select low code development platforms?

EasyCVR配置中心录像计划页面调整分辨率时的显示优化

How to turn on win11 game mode? How to turn on game mode in win11

#DAYU200体验官#MPPT光伏发电项目 DAYU200、Hi3861、华为云IotDA

Index summary (assault version)

双塔模型的最强出装,谷歌又开始玩起“老古董”了?

大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
随机推荐
Get the week start time and week end time of the current date
[azure microservice service fabric] start the performance monitor in the SF node and set the method of capturing the process
Tsconfig of typescript TS basics JSON configuration options
How polardb-x does distributed database hotspot analysis
What is the difference between the three values of null Nan undefined in JS
Build your own website (18)
DNS series (I): why does the updated DNS record not take effect?
使用 CustomPaint 绘制基本图形
vite Unrestricted file system access to
Matplotlib drawing interface settings
OpenGL job coordinate system
Jerry's test box configuration channel [chapter]
JS number is insufficient, and 0 is added
Record a garbled code during servlet learning
How to make agile digital transformation strategy for manufacturing enterprises
Write in front -- Talking about program development
Px4 autonomous flight
Record layoutrebuild Forcerebuildlayoutimmediate does not take effect
Two methods of calling WCF service by C #
Song list 11111