LoadFrom Method (ExternalResourceReference, WorksetConfiguration)


Revit Link Type Load From(External Resource Reference, Workset Configuration) Method

Loads or reloads the Revit link. The link will be loaded from the location given in the input ExternalResourceReference.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public LinkLoadResult LoadFrom(
	ExternalResourceReference resourceReference,
	WorksetConfiguration config
)

Parameters

resourceReference ExternalResourceReference
An external resource reference describing the source of the linked Revit document.
config WorksetConfiguration

A WorksetConfiguration object indicating which worksets in the link to open.

If you want to load the same set of worksets the link previously had, leave this argument as .

Return Value

LinkLoadResult
An object containing the ElementId of the link and an enum value indicating any errors which occurred while trying to load.
Exceptions
Exception Condition
ArgumentException 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.
ArgumentNullException A non-optional argument was null
FileAccessException The model cannot be accessed due to lack of access privileges.
ForbiddenForDynamicUpdateException The function is not permitted during dynamic update.
InvalidOperationException This RevitLinkType is not a top-level link. -or- The link "this RevitLinkType" is loaded into multiple documents and cannot be reloaded. -or- The element "this RevitLinkType" is in a closed workset. -or- There is a transaction phase left open (such as a transaction, sub-transaction of transaction group) at the time of invoking this method. -or- The document is read-only. It cannot be modified. -or- The document is in an edit mode or is in family mode. -or- Revit cannot customize worksets for this model.
Remarks

If the link is currently loaded, Revit must unload the link before reloading it. Any changes made in-memory to the link's shared coordinates will be discarded.

Revit does not try to validate that the input represents the "same" document. You can load a completely different document, which may invalidate references to linked elements.

This function regenerates the document.

The document's Undo history will be cleared by this command. As a result, this command and others executed before it cannot be undone. All transaction phases (e.g. transactions transaction groups and sub-transaction) that were explicitly started must be finished prior to calling this method.

See Also