RevitLinkType.Create(Document, ExternalResourceReference, RevitLinkOptions)
Method
Description:
Creates a new Revit link type from an external resource reference and loads the linked document.
Creates a new Revit link type from an external resource reference and loads the linked document.
Remarks:
This function regenerates the input document.
Only the WorksetConfiguration information in the options argument will be used. The path type information will be ignored.
Syntax
public static LinkLoadResult Create(
Document document,
ExternalResourceReference resourceReference,
RevitLinkOptions options
)
Parameters
Parameter | Type | Description |
---|---|---|
document | Document | The document in which to create the Revit link. |
resourceReference | ExternalResourceReference | An external resource reference describing the source of the linked Revit document. |
options | RevitLinkOptions | An options class for loading Revit links. The path type information will be ignored. |
Return Value
Type | Description |
---|---|
LinkLoadResult | An object containing the results of creating and loading the Revit link type. It contains the ElementId of the new link. |
Exceptions
Exception | Condition |
---|---|
ArgumentException | document is not a project document. -or- The server referenced by the ExternalResourceReference does not exist or does not implement IExternalResourceServer. -or- The server referenced by the ExternalResourceReference cannot support Revit links. -or- The ExternalResourceReference (resourceReference) is not in a format that is supported by its server. -or- The link type referred to by the ExternalResourceReference "resourceReference" already exists in the document. You cannot create another copy of the link type. You can create instances with RevitLinkInstance.Create(), or reload the link using RevitLinkType.Reload(). |
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | Revit cannot customize worksets for this model. |
ModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. |
ModificationOutsideTransactionException | The document has no open transaction. |