ExternalResourceReference
Description:
This class identifies an external resource provided by an IExternalResourceServer.
This class identifies an external resource provided by an IExternalResourceServer.
Remarks:
The class contains:
- The id of the IExternalResourceServer from which the resource was obtained.
- A (String, String) map containing information that is meaningful to the server for accessing the desired data. This could be something as simple as "4" to indicate that Revit wants option 4 from a range of several choices, or something more detailed, such as a filename or directory path.
- A String indicating the version of the resource that was most recently loaded in Revit.
- A (String, String) map containing "in session" information that is meaningful to the server, but which does not need to be saved permanently in the document on disk.
When calling an IExternalResourceServer, Revit will provide an ExternalResourceReference to identify the specific resource that Revit is using from that server. The server can then use the relevant information in the (String, String) maps to retrieve the data from the correct source.
public class ExternalResourceReference : IDisposable
| Name | Return Type | Description |
|---|---|---|
| ExternalResourceReference(ExternalResourceReference) | None | Creates a new ExternalResourceReference from the given ExternalResourceReference. |
| ExternalResourceReference(Guid, IDictionary<String, String>, String, String) | None | Creates a new ExternalResourceReference from the given data. |
| Name | Return Type | Description |
|---|---|---|
| CreateLocalResource(Document, ExternalResourceType, ModelPath, PathType) | ExternalResourceReference | Creates an ExternalResourceReference representing a local file managed by Revit's built-in server. |
| Dispose() | None | Releases all resources used by the |
| GetReferenceInformation() | IDictionary | Returns a copy of an object containing previously-stored reference or lookup information about the specific resource provided by the server. |
| GetResourceShortDisplayName() | string | Gets the short display name of the external resource. |
| GetResourceVersionStatus() | ResourceVersionStatus | Checks whether this ExternalResourceReference corresponds to the current version of the resource. |
| HasValidDisplayPath() | bool | Checks whether this external Resource has a valid display path. |
| IsValidReference(ExternalResourceType) | bool | Checks whether the reference is in a valid format. |
| Name | Return Type | Description |
|---|---|---|
| InSessionPath | string | The path stores the full display path which includes the server name plus the path provided by ExternalResourceServer.The path that Revit will present for user recognizing and browsing to this resource during one session of Revit. |
| IsValidObject | bool | Specifies whether the .NET object represents a valid Revit entity. |
| ServerId | Guid | The id of the server that Revit is expecting to provide the external resource. |
| Version | string | The version of the external data that was most recently loaded in Revit. |