I am desperately trying to prevent revit from receiving a delete command while in a modeless form (one that was displayed with Show() and not Showdialog()), but I can’t seem to be able to stop it.
My problem is my form contains textboxes: its core function requires the user to be able to navigate (pan and zoom) in revit without having to close and reopen the form.
But as soon as the user presses delete on any textbox text revit thinks the user has entered a delete command in the main window, and this could lead to accidental deletions.
Note the api queries a revitdb based on selected entities (families) and is then they are able to rename the family type or family name, using a textbox and ‘apply’ button. But as soon as they hit the delete button on the keyboard, guess what – the entity is deleted in revit.
I’ve spend 10 hours on this and it could turn out to be catastrophic to my plans.
Kind regards,
Joshua Lumley