当前位置:网站首页>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);
}
}
}
}
边栏推荐
- Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
- Two methods of calling WCF service by C #
- Anti climbing killer
- Pdf document signature Guide
- Jerry's key to initiate pairing [chapter]
- 三元表达式、各生成式、匿名函数
- 648. Word replacement
- Typeorm automatically generates entity classes
- Tcp/ip protocol stack
- How to make agile digital transformation strategy for manufacturing enterprises
猜你喜欢
[JDBC Part 1] overview, get connection, CRUD
648. Word replacement
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
建立自己的网站(18)
UWA问答精选
Solve the problem of uni in uni app Request sent a post request without response.
How to make agile digital transformation strategy for manufacturing enterprises
It's worth seeing. Interview sites and interview skills
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?
Application practice | the efficiency of the data warehouse system has been comprehensively improved! Data warehouse construction based on Apache Doris in Tongcheng digital Department
随机推荐
Embedded development: how to choose the right RTOS for the project?
How to close eslint related rules
23. Merge K ascending linked lists -c language
PKPM 2020 software installation package download and installation tutorial
谈谈制造企业如何制定敏捷的数字化转型策略
ByteDance senior engineer interview, easy to get started, fluent
Relationship between URL and URI
用语雀写文章了,功能真心强大!
How polardb-x does distributed database hotspot analysis
反爬通杀神器
Revit secondary development - cut view
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
[open source] Net ORM accessing Firebird database
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
. Net automapper use
[azure microservice service fabric] the service fabric cluster hangs up because the certificate expires (the upgrade cannot be completed, and the node is unavailable)
Remember an experience of using selectmany
Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘
How to realize the movement control of characters in horizontal game
UWA问答精选