Now, another potential dialog box that we can dismiss is a little bit more complicated. 33 – This is how to override the result, and again 1002 is the second button from the top, so we are simulating a user pressing that button.32 – We are only interested in one, very specific Task Dialog, so that’s why I am checking for a DialogId here.14 – This is how to unsubscribe from that event, so it only works when we are inside of our command.10 – This is how you can subscribe to the DialogBoxShowing event.Just to break down a few of the important lines of code here: I don’t want my plugin to constantly dismiss this dialog, rather only when I am executing a command that would open a file from the API. ![]() Why? Because I want this override to only kick in and last when I am performing this specific task. Please note that I put that code into the actual ExternalCommand class. Here’s a sample command code to handle that dialog: ![]() As Jeremy mentions, you can set it’s result – simulate a user pressing one of the buttons – by overriding the result for that window with a value of 1001 ( Open Manage Links to correct the problem) or 1002 ( Ignore and continue opening the project). So the image above with the links error, is really a TaskDialog. ![]() That’s what Jeremy is talking about in the above article. The way these are manifested is via the DialogBoxShowingEventArgs which is a base class for two other classes: MessageBoxShowingEventArgs and TaskDialogShowingEventArgs. It basically classifies the three different types of dialog boxes that Revit will show you.
0 Comments
Leave a Reply. |