OpenIFCDocument Method (String, IFCImportOptions)


Opens an IFC document from disk using custom options.

Namespace: Autodesk.Revit.ApplicationServices
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2015

Syntax

C#
public Document OpenIFCDocument(
	string fileName,
	IFCImportOptions importOptions
)
Visual Basic
Public Function OpenIFCDocument ( _
	fileName As String, _
	importOptions As IFCImportOptions _
) As Document
Visual C++
public:
Document^ OpenIFCDocument(
	String^ fileName, 
	IFCImportOptions^ importOptions
)

Parameters

fileName
Type: SystemString
The IFC file to be opened.
importOptions
Type: Autodesk.Revit.DB.IFCIFCImportOptions
The options for this import.

Return Value

The newly created document containing the IFC file.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException If 'fileName' is an empty string.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsFileArgumentNotFoundException If the file specified by 'fileName' cannot be found.
Autodesk.Revit.ExceptionsInvalidOperationException If Revit is missing document templates or if the file cannot be opened.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →