当前位置:网站首页>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);
}
}
}
}边栏推荐
- Reinforcement learning - learning notes 9 | multi step TD target
- 【Azure微服务 Service Fabric 】因证书过期导致Service Fabric集群挂掉(升级无法完成,节点不可用)
- 戴森官方直营店免费造型服务现已开放预约 先锋科技诠释护发造型理念,助力消费者解锁多元闪耀造型
- OpenGL job - texture
- Jerry's about TWS pairing mode configuration [chapter]
- Solve the problem of uni in uni app Request sent a post request without response.
- 强化学习-学习笔记9 | Multi-Step-TD-Target
- Song list 11111
- 【JDBC Part 1】概述、获取连接、CRUD
- 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?
猜你喜欢

大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
![[开源] .Net ORM 访问 Firebird 数据库](/img/a2/4eff4f0af53bf3b9839a73019a212f.png)
[开源] .Net ORM 访问 Firebird 数据库

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?

建立自己的网站(18)

It's worth seeing. Interview sites and interview skills

How to realize the movement control of characters in horizontal game

. Net automapper use

Remember aximp once Use of exe tool

Dayu200 experience officer MPPT photovoltaic power generation project dayu200, hi3861, Huawei cloud iotda
随机推荐
null == undefined
Which futures company is the safest to open a futures account?
Two kinds of updates lost and Solutions
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cyclic functions [chapter]
谈谈制造企业如何制定敏捷的数字化转型策略
How polardb-x does distributed database hotspot analysis
How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525
Revit secondary development - wall opening
怎样写一个增广矩阵到txt文件中
[advanced MySQL] index details (I): index data page structure
Jerry's about TWS channel configuration [chapter]
Crawler (17) - Interview (2) | crawler interview question bank
VTOL in Px4_ att_ Control source code analysis [supplement]
Get the week start time and week end time of the current date
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
Overseas agent recommendation
Anti climbing killer
ByteDance Android interview, summary of knowledge points + analysis of interview questions
[open source] Net ORM accessing Firebird database
Reinforcement learning - learning notes 9 | multi step TD target