当前位置:网站首页>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();
}边栏推荐
- 【Azure微服务 Service Fabric 】在SF节点中开启Performance Monitor及设置抓取进程的方式
- SAR image quality evaluation
- How does win11 time display the day of the week? How does win11 display the day of the week today?
- Embedded development: how to choose the right RTOS for the project?
- 如何实现横版游戏中角色的移动控制
- Blender exchange group, welcome to the water group ~
- OpenGL job - texture
- 【Azure微服务 Service Fabric 】因证书过期导致Service Fabric集群挂掉(升级无法完成,节点不可用)
- Cannot find module 'xxx' or its corresponding type declaration
- 客户案例|华律网,通过观测云大幅缩短故障定位时间
猜你喜欢

The whole network "chases" Zhong Xuegao

用语雀写文章了,功能真心强大!

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

PKPM 2020 software installation package download and installation tutorial

Time standard library

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

Application practice | the efficiency of the data warehouse system has been comprehensively improved! Data warehouse construction based on Apache Doris in Tongcheng digital Department

Debugging and handling the problem of jamming for about 30s during SSH login

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?
随机推荐
The difference between NPM uninstall and RM direct deletion
建立自己的网站(18)
Anti climbing killer
23. Merge K ascending linked lists -c language
What is the difference between the three values of null Nan undefined in JS
This experimental syntax requires enabling the parser plugin: ‘optionalChaining‘
Dbsync adds support for mongodb and ES
客户案例|华律网,通过观测云大幅缩短故障定位时间
变量与常量
Node:504 error reporting
强化学习-学习笔记9 | Multi-Step-TD-Target
Reptile combat (VII): pictures of the king of reptiles' heroes
Jerry's manual matching method [chapter]
Blender exchange group, welcome to the water group ~
Remove the default background color of chrome input input box
OpenGL jobs - shaders
[JDBC Part 1] overview, get connection, CRUD
Record problems fgui tween animation will be inexplicably killed
Interview question 01.02 Determine whether it is character rearrangement - auxiliary array algorithm
强化学习-学习笔记9 | Multi-Step-TD-Target