当前位置:网站首页>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);
}
}
}
}边栏推荐
- How polardb-x does distributed database hotspot analysis
- Leetcode SQL first day
- 戴森官方直营店免费造型服务现已开放预约 先锋科技诠释护发造型理念,助力消费者解锁多元闪耀造型
- 100million single men and women "online dating", supporting 13billion IPOs
- Have you ever been confused? Once a test / development programmer, ignorant gadget C bird upgrade
- Welcome to CSDN markdown editor
- 648. Word replacement
- Record problems fgui tween animation will be inexplicably killed
- [colmap] sparse reconstruction is converted to mvsnet format input
- Matplotlib drawing interface settings
猜你喜欢

Win11U盘不显示怎么办?Win11插U盘没反应的解决方法

Tcp/ip protocol stack

Cannot find module 'xxx' or its corresponding type declaration

强化学习-学习笔记9 | Multi-Step-TD-Target

海外代理推荐

QT compile IOT management platform 39 alarm linkage

Px4 autonomous flight

How to choose the appropriate automated testing tools?

Reinforcement learning - learning notes 9 | multi step TD target

如何选择合适的自动化测试工具?
随机推荐
Jerry's fast pairing does not support canceling pairing [article]
Display optimization when the resolution of easycvr configuration center video recording plan page is adjusted
Jerry's key to initiate pairing [chapter]
OpeGL personal notes - lights
Remember an experience of using selectmany
[interview arrangement] 0211 game engine server
Win11时间怎么显示星期几?Win11怎么显示今天周几?
使用 BlocConsumer 同时构建响应式组件和监听状态
戴森官方直营店免费造型服务现已开放预约 先锋科技诠释护发造型理念,助力消费者解锁多元闪耀造型
Cannot find module 'xxx' or its corresponding type declaration
Typeorm automatically generates entity classes
Px4 autonomous flight
Reptile combat (VII): pictures of the king of reptiles' heroes
用语雀写文章了,功能真心强大!
The latest Android interview collection, Android video extraction audio
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?
. Net automapper use
[JDBC Part 1] overview, get connection, CRUD
operator
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cyclic functions [chapter]