public static LinkLoadResult CreateFromIFC( Document document, string ifcFilePath, string revitLinkedFilePath, bool recreateLink, RevitLinkOptions options )
| Exception | Condition |
|---|---|
| ArgumentException | document is not a project document. -or- The input path "ifcFilePath" does not represent an IFC file. -or- document already contains a linked model at path revitLinkedFilePath. -or- The document is a cloud model. |
| ArgumentNullException | A non-optional argument was null |
| FileAccessException | The model cannot be accessed due to lack of access privileges. |
| FileArgumentNotFoundException | There is not a valid Revit file at ifcFilePath's location -or- There is not a valid Revit file at revitLinkedFilePath's location |
| InvalidOperationException | The file is not allowed to access. -or- Revit cannot customize worksets for this model. |
| 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. |
This function is one of a series of steps necessary for linking an IFC file. To understand how it is used in context, please download the IFC open source code, and look in the Revit.IFC.Import project at Importer.ImportIFC(ImporterIFC importer), under the IFCImportAction.Link branch.
This function regenerates the input document. While the options argument allows specification of a path type, the input path argument must be a full path. Relative vs. absolute determines how Revit will store the path, but it needs a complete path to find the linked document initially.