当前位置:网站首页>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);
}
}
}
}
边栏推荐
- 使用 BlocConsumer 同时构建响应式组件和监听状态
- Revit secondary development - project file to family file
- [open source] Net ORM accessing Firebird database
- 用语雀写文章了,功能真心强大!
- Antd date component appears in English
- EasyCVR配置中心录像计划页面调整分辨率时的显示优化
- OpenGL homework - Hello, triangle
- How to make agile digital transformation strategy for manufacturing enterprises
- How to realize the movement control of characters in horizontal game
- Jerry's configuration of TWS cross pairing [article]
猜你喜欢
[azure microservice service fabric] how to transfer seed nodes in the service fabric cluster
How to make agile digital transformation strategy for manufacturing enterprises
Solve the problem of uni in uni app Request sent a post request without response.
如何选择合适的自动化测试工具?
Implementation method of data platform landing
Kirin Xin'an operating system derivative solution | storage multipath management system, effectively improving the reliability of data transmission
如何选择合适的自动化测试工具?
建立自己的网站(18)
如何实现横版游戏中角色的移动控制
Why can't win11 display seconds? How to solve the problem that win11 time does not display seconds?
随机推荐
Relationship between URL and URI
Get the week start time and week end time of the current date
The free styling service of Dyson's official direct store is now open for appointment. Pioneer Technology interprets the styling concept of hair care and helps consumers unlock diversified and shiny s
Reinforcement learning - learning notes 9 | multi step TD target
[advanced MySQL] index details (I): index data page structure
Use partial derivatives to display normals in unity
OpenGL job - texture
An in-depth understanding of fp/fn/precision/recall
Revit secondary development - get the thickness / length / height of the beam
Vs custom template - take the custom class template as an example
MIT6.S081-Lab9 FS [2021Fall]
变量与常量
How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525
How to realize the movement control of characters in horizontal game
PDF文档签名指南
[interview arrangement] 0211 game engine server
How to write an augmented matrix into TXT file
How to close eslint related rules
Build your own website (18)
Attitude estimation (complementary filtering)