当前位置:网站首页>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();
}
边栏推荐
- Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘
- Reinforcement learning - learning notes 9 | multi step TD target
- null == undefined
- 【Azure微服务 Service Fabric 】在SF节点中开启Performance Monitor及设置抓取进程的方式
- Matplotlib drawing interface settings
- What is the difference between the three values of null Nan undefined in JS
- 谈谈制造企业如何制定敏捷的数字化转型策略
- [azure microservice service fabric] start the performance monitor in the SF node and set the method of capturing the process
- Oracle advanced (VI) Oracle expdp/impdp details
- 【JDBC Part 1】概述、获取连接、CRUD
猜你喜欢
How to choose the appropriate automated testing tools?
谈谈制造企业如何制定敏捷的数字化转型策略
The function is really powerful!
How does win11 unblock the keyboard? Method of unlocking keyboard in win11
L'enregistreur de disque dur NVR est connecté à easycvr par le Protocole GB 28181. Quelle est la raison pour laquelle l'information sur le canal de l'appareil n'est pas affichée?
#DAYU200体验官#MPPT光伏发电项目 DAYU200、Hi3861、华为云IotDA
The strongest installation of the twin tower model, Google is playing "antique" again?
PKPM 2020软件安装包下载及安装教程
EasyCVR配置中心录像计划页面调整分辨率时的显示优化
Build your own website (18)
随机推荐
VTOL in Px4_ att_ Control source code analysis [supplement]
嵌入式开发:如何为项目选择合适的RTOS?
Win11U盘不显示怎么办?Win11插U盘没反应的解决方法
Get the week start time and week end time of the current date
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
Leetcode SQL first day
Blender exchange group, welcome to the water group ~
Win11时间怎么显示星期几?Win11怎么显示今天周几?
OpenGL job - texture
Welcome to CSDN markdown editor
强化学习-学习笔记9 | Multi-Step-TD-Target
This experimental syntax requires enabling the parser plugin: ‘optionalChaining‘
Record layoutrebuild Forcerebuildlayoutimmediate does not take effect
JS number is insufficient, and 0 is added
L'enregistreur de disque dur NVR est connecté à easycvr par le Protocole GB 28181. Quelle est la raison pour laquelle l'information sur le canal de l'appareil n'est pas affichée?
Google SEO external chain backlinks research tool recommendation
【JDBC Part 1】概述、获取连接、CRUD
Reinforcement learning - learning notes 9 | multi step TD target
Attitude estimation (complementary filtering)
Jerry's key to initiate pairing [chapter]