In one of my addins, i am capturing dialog boxes to automatically handle them.
I do this by implementing an new event handler based upon the DialogBoxShowingEventArgs
This seems to capture most of the dialog boxes that block revit in its code excecution, though it doesnt seem to get all of the dialogboxes.
Example Given: When exporting an empty 3D view to navisworks nwc, the Document.Export is called for the navisworks exporter.
So in this case its actually the exporter giving the DialogBox rather then revit itself, so it makes sense in some way that the eventhandler doesnt capture it. Image of the Dialogbox:
i believe there is a few more of these dialogboxes in other functions that dont like to be captured, but the question would be the same:
I was wondering if it is somehow still possible to capture these dialogboxes or auto dispatch them either trough the eventhandler or otherwise?
Solved! Go to Solution.
Solved by zhong_wu. Go to Solution.
Hi Dante,
Just as you already noticed, Revit provides a nice Event Autodesk.Revit.UI.UIControlledApplication.DialogBoxShowing to allow developers to implement an add-in application to handle some Revit dialog automatically, our dear Jeremy had a great blog post at http://thebuildingcoder.typepad.com/blog/2009/06/autoconfirm-save-using-dialogboxshowing-event.html years ago which clearly described how to work with that, please check that if you haven't(I believe you should already reviewed ).
Unfortunately, as noted in the blog post on using the DialogBoxShowing event, some of the Revit dialogues, of course the dialog pop up in navisworks exporter as you plan to work with as example, do not raise such an event when displayed, so we cannot use the standard Revit API to handle or dismiss them. If you want to handle them, actually, it's not a Revit question, but a Windows API question, again, Jeremy provided another sample to handle that at http://thebuildingcoder.typepad.com/blog/2009/10/dismiss-dialogue-using-windows-api.html , the code is also there, please check and hope it helps somewhat.
Good luck.
Can't find what you're looking for? Ask the community or share your knowledge.