Revit 2025.3 API
DocumentLink(String, DWFImport |
Links Markups in a DWF file into the project document.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public IList<ElementId> Link( string file, DWFImportOptions options )
Public Function Link ( file As String, options As DWFImportOptions ) As IList(Of ElementId)
public: IList<ElementId^>^ Link( String^ file, DWFImportOptions^ options )
member Link : file : string * options : DWFImportOptions -> IList<ElementId>
Parameters
- file String
- Full path of the file to link. File must exist and must be a valid DWF file.
- options DWFImportOptions
- Various link options applicable to the DWF format.
Return Value
IListElementIdA collection of link instance element ids created by the markup link.

Exception | Condition |
---|---|
ArgumentException | Not a valid file for DWF import (.dwf or.dwfx files are valid). -or- Some of the views are not importable. |
ArgumentNullException | A non-optional argument was null |
FileArgumentNotFoundException | The given file does not exist. |
InvalidOperationException | Import is temporarily disabled. -or- This Document is not a project document. |
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. |

Link isn't supported for family documents. Please use import instead.
See Also