- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The add-in finishes the operation without a fatal error if the user simply finishes the command by selecting another element than a wall, however If they press esc and revit can't resolve walls contorted back onto themselves by deleting or unjoing geometry the revit application crashes. This shouldn't occur in normal operation however if a user were to be silly and use the tool inappropriately it is a real danger. Is there any way of preventing the user from pressing the escape key?
I currently handle the user ending the command with esc or right mouse with the below code...
}//end execute method
//If the user right-clicks or presses Esc, handle the exception
catch (Autodesk.Revit.Exceptions.OperationCanceledException)
{
return Result.Cancelled;
}
//Catch other errors
catch (Exception ex)
{
message = ex.Message;
return Result.Failed;
}
Solved! Go to Solution.