LoadFrom Method (ExternalResourceReference, WorksetConfiguration)


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: 16.0.0.0 (16.0.0.0)
Since: 2015

Syntax

C#
public RevitLinkLoadResult LoadFrom(
	ExternalResourceReference resourceReference,
	WorksetConfiguration config
)
Visual Basic
Public Function LoadFrom ( _
	resourceReference As ExternalResourceReference, _
	config As WorksetConfiguration _
) As RevitLinkLoadResult
Visual C++
public:
RevitLinkLoadResult^ LoadFrom(
	ExternalResourceReference^ resourceReference, 
	WorksetConfiguration^ config
)

Parameters

resourceReference
Type: Autodesk.Revit.DB ExternalResourceReference
An external resource reference describing the source of the linked Revit document.
config
Type: Autodesk.Revit.DB 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 a null reference ( Nothing in Visual Basic) .

Return Value

An object containing the ElementId of the link and an enum value indicating any errors which occurred while trying to load.

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.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions 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.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions FileAccessException The model cannot be accessed due to lack of access privileges.
Autodesk.Revit.Exceptions ForbiddenForDynamicUpdateException The function is not permitted during dynamic update.
Autodesk.Revit.Exceptions 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.

See Also