当前位置:网站首页>Revit secondary development - intercept project error / warning pop-up
Revit secondary development - intercept project error / warning pop-up
2022-07-07 22:23:00 【Hey, hey, hey, hey, hey】
Intercept errors in the project / Warning pop up .
public Result Execute(ExternalComandData commandData,ref string message,ElementSet elements)
{
commandData.Application.Application.FailuresProcessing += Application_FailuresProcessing;
return Result.Succeeded;
}
private void Application_FailuresProcessing(object sender,Autodesl.Revit.DB.Event.FailuresProcessingEventArgs e)
{
FailuresAccessor fa = .GetDailureAccessor();
IList<FailureMessageAccessor> lstFma = fa.GetFailureMessages();
foreach(FailureMessageAccessor item in lstFma)
{
if(item.GetSeverity() == FailureSeverity.Warning)
{
fa.DeleteWarning(item);
e.SetProcessingResult(FailureProcessingResult.Continue);
}
else if(item.GetSeverity() == FailureSeverity.Error)
{
if(item.HasResolutions())
{
// error message
string _failureMessage = fa.GetDescriptionText();
if( Is a negligible error )
{// Don't show error Popup
FailureHandlingOptions fho = fa.GetFailureHandlingOptions();
fho.SetClearAfterRollback(true);
fa.SetFailureHandlingOptions(fho);
}
e.SetProcessingResult(FailureProcessingResult.ProceedWithRollBack);
}
}
}
}
边栏推荐
- Tsconfig of typescript TS basics JSON configuration options
- SAR image quality evaluation
- How to realize the movement control of characters in horizontal game
- 【Azure微服务 Service Fabric 】在SF节点中开启Performance Monitor及设置抓取进程的方式
- operator
- SAR影像质量评估
- Welcome to CSDN markdown editor
- Revit secondary development - modify wall thickness
- This experimental syntax requires enabling the parser plugin: ‘optionalChaining‘
- QT compile IOT management platform 39 alarm linkage
猜你喜欢
Win11如何解禁键盘?Win11解禁键盘的方法
Anti climbing killer
使用 BlocConsumer 同时构建响应式组件和监听状态
null == undefined
Paint basic graphics with custompaint
[open source] Net ORM accessing Firebird database
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
vite Unrestricted file system access to
Two methods of calling WCF service by C #
海外代理推荐
随机推荐
OpeGL personal notes - lights
Index summary (assault version)
Crawler (17) - Interview (2) | crawler interview question bank
TCP/IP 协议栈
Embedded development: how to choose the right RTOS for the project?
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cyclic functions [chapter]
Record layoutrebuild Forcerebuildlayoutimmediate does not take effect
Reinforcement learning - learning notes 9 | multi step TD target
Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
Px4 autonomous flight
强化学习-学习笔记9 | Multi-Step-TD-Target
如何实现横版游戏中角色的移动控制
OpenGL job coordinate system
NVR hard disk video recorder is connected to easycvr through the national standard gb28181 protocol. What is the reason why the device channel information is not displayed?
Latest Android advanced interview questions summary, Android interview questions and answers
ByteDance senior engineer interview, easy to get started, fluent
反爬通杀神器
The strongest installation of the twin tower model, Google is playing "antique" again?
How to close eslint related rules
Tcp/ip protocol stack