当前位置:网站首页>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);
}
}
}
}边栏推荐
- 强化学习-学习笔记9 | Multi-Step-TD-Target
- The difference between NPM uninstall and RM direct deletion
- The function is really powerful!
- Jerry's fast pairing does not support canceling pairing [article]
- [open source] Net ORM accessing Firebird database
- Px4 autonomous flight
- Revit secondary development - get the thickness / length / height of the beam
- 大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
- Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
- 海外代理推荐
猜你喜欢

The function is really powerful!

Display optimization when the resolution of easycvr configuration center video recording plan page is adjusted

. Net automapper use

Use blocconsumer to build responsive components and monitor status at the same time

ByteDance senior engineer interview, easy to get started, fluent

It's worth seeing. Interview sites and interview skills
![Jerry's about TWS channel configuration [chapter]](/img/94/fde5054fc412b786cd9864215e912c.png)
Jerry's about TWS channel configuration [chapter]

Dayu200 experience officer MPPT photovoltaic power generation project dayu200, hi3861, Huawei cloud iotda

海外代理推荐

Two methods of calling WCF service by C #
随机推荐
使用 BlocConsumer 同时构建响应式组件和监听状态
Build your own website (18)
TCP/IP 协议栈
Main functions of OS, Sys and random Standard Libraries
Typescript TS basic knowledge type declaration
Time standard library
Kaggle-Titanic
OpenGL jobs - shaders
Song list 11111
SAR影像质量评估
Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
Jerry's about TWS pairing mode configuration [chapter]
Use blocconsumer to build responsive components and monitor status at the same time
Jerry's about TWS channel configuration [chapter]
Revit secondary development - get the thickness / length / height of the beam
OpenGL configuration vs2019
怎样写一个增广矩阵到txt文件中
[interview arrangement] 0211 game engine server
海外代理推荐
This experimental syntax requires enabling the parser plugin: ‘optionalChaining‘