IExternal |
void HandleLoadResourceResults( Document document, IList<ExternalResourceLoadData> loadData )
The ExternalResourceLoadData contains a property, ErrorsReported, which the server can use to indicate whether it handled any errors for the resource.
For Revit links specifically, Revit will check this value to see if it should report errors about a given link in the Unresolved References dialog. An IExternalResourceUIServer can set this value to true to avoid redundant messages.
Note that it is possible for Revit to encounter errors internally even if the server successfully provides a reference. In general, this value should only be set to true if the server has reported an error condition.
This method will be called automatically by Revit after the external resource load process is complete.
Note that automatic loads can occur in the context of other operations such as opening a file. During automatic loads, it is therefore recommended that the server only display UI that is critical for the user to see (such as error message).
The loading operation type is Explicit when the user is specifically trying to reload the resource. During explicit loads, it may be desirable to provide more feedback to the user, such as specific feedback that the load operation succeeded.
The loading operation type can be accessed through ExternalResourceLoadContext.
Note that providing messages and other UI feedback for Revit links is more complicated, because links can be nested. The UI server may wish to provide different messages and take different actions, depending on whether a link loaded from the DB server was a "top-level" link, or was nested. For example, while it may be possible to correct an error that occurred with a top-level link by loading it directly, this cannot be done with a nested link, as Revit will throw an exception.
To complicate things further, the same Revit document may appear more than once in a tree of nested links, and the UI server should avoid repeatedly posting the same message for instances of that document.
To help UI servers handle situations where a nested tree of links is loaded: