当前位置:网站首页>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();
}边栏推荐
- Song list 11111
- Application practice | the efficiency of the data warehouse system has been comprehensively improved! Data warehouse construction based on Apache Doris in Tongcheng digital Department
- NVR硬盤錄像機通過國標GB28181協議接入EasyCVR,設備通道信息不顯示是什麼原因?
- How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525
- DBSync新增对MongoDB、ES的支持
- Can I open a stock account directly online now? Is it safe?
- Jerry's about TWS channel configuration [chapter]
- [open source] Net ORM accessing Firebird database
- Remove the default background color of chrome input input box
- Record problems fgui tween animation will be inexplicably killed
猜你喜欢
Latest Android advanced interview questions summary, Android interview questions and answers

How does win11 unblock the keyboard? Method of unlocking keyboard in win11

反爬通杀神器

Win11U盘不显示怎么办?Win11插U盘没反应的解决方法
Talk about relational database and serverless

【Azure微服务 Service Fabric 】在SF节点中开启Performance Monitor及设置抓取进程的方式

DNS series (I): why does the updated DNS record not take effect?

Node:504 error reporting

ByteDance Android interview, summary of knowledge points + analysis of interview questions

双塔模型的最强出装,谷歌又开始玩起“老古董”了?
随机推荐
Jerry's fast pairing does not support canceling pairing [article]
Reinforcement learning - learning notes 9 | multi step TD target
This experimental syntax requires enabling the parser plugin: ‘optionalChaining‘
Why can't win11 display seconds? How to solve the problem that win11 time does not display seconds?
Have you ever been confused? Once a test / development programmer, ignorant gadget C bird upgrade
Record a garbled code during servlet learning
How does win11 time display the day of the week? How does win11 display the day of the week today?
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cyclic functions [chapter]
Latest Android advanced interview questions summary, Android interview questions and answers
How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525
强化学习-学习笔记9 | Multi-Step-TD-Target
Talk about relational database and serverless
[interview arrangement] 0211 game engine server
operator
TCP/IP 协议栈
PKPM 2020 software installation package download and installation tutorial
L2: current situation, prospects and pain points of ZK Rollup
How to turn on win11 game mode? How to turn on game mode in win11
OpenGL configuration vs2019
Tcp/ip protocol stack