CADLinkTypeLoadFrom(String) Method

Loads or reloads the DWG link from the given file path.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public LinkLoadResult LoadFrom(
	string path
)

Parameters

path  String
A path on disk giving the location of the linked file. This path must be absolute. The link's path will remain PathType.Absolute or PathType.Relative, whichever it was before. If the link was previously to an external server location, the path type will be relative.

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
ExceptionCondition
ArgumentNullException A non-optional argument was null
FileArgumentNotFoundException The given path does not exist.
InvalidOperationException This CADLinkType represents an import and cannot be used as a link. -or- The element "this CADLinkType" is in a read-only document. -or- The link does not represent a DWG.
Remarks

If the link is currently loaded, any changes made in-memory to the link's shared coordinates will be discarded.

Graphic overrides will be preserved on reload.

If the original view used to bring in this link has been deleted, Revit will cancel the load.

If there is already another link, not current link itself, using the given file path, the loading will not happen. The element id of the link using the file path will be contained in the LinkLoadResult.

If the link type identified by the given path doesn't match DWG, the load will not proceed.

See Also