LoadFrom Method (ModelPath, WorksetConfiguration)


Loads or reloads the Revit link from disk. The link will be loaded from the input path.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 16.0.0.0 (16.0.0.0)
Since: 2014

Syntax

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

Parameters

path
Type: Autodesk.Revit.DB ModelPath
A ModelPath indicating where to load the link from. This must be an absolute path.
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

The input path must be absolute. Revit will store an absolute or relative path internally, according to the link's settings. Revit Server paths are acceptable.

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 path 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 input path "path" does not represent a Revit model.
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 FileArgumentNotFoundException There is not a valid Revit file at path's location
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