Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

capturing dialogboxes

1 REPLY 1
SOLVED
Reply
Message 1 of 2
dante.van.wettum
612 Views, 1 Reply

capturing dialogboxes

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:

diag.png

 

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?

1 REPLY 1
Message 2 of 2
zhong_wu
in reply to: dante.van.wettum

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 Smiley Wink ).    

 

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. 


John Wu
Developer Technical Services
Autodesk Developer Network


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report