Imports a Green-Building XML file into the document.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)

Syntax

C#
public bool Import(
	string file,
	GBXMLImportOptions options
)
Visual Basic
Public Function Import ( _
	file As String, _
	options As GBXMLImportOptions _
) As Boolean
Visual C++
public:
bool Import(
	String^ file, 
	GBXMLImportOptions^ options
)

Parameters

file
Type: System..::..String
Full path of the file to import. File must exist.
options
Type: Autodesk.Revit.DB..::..GBXMLImportOptions
Various options applicable to GBXml import. If nullNothingnullptra null reference (Nothing in Visual Basic), all options will be set to their respective default values.

Return Value

True if successful, otherwise False.

Remarks

This method is available only in MEP. Though the 'options' argument is not currently used, an object still must be provided (may be nullNothingnullptra null reference (Nothing in Visual Basic)). The method will return False if not succeed. e.g when the input xml file does not contain any result elements.

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentNullExceptionThrown when file argument is nullNothingnullptra null reference (Nothing in Visual Basic) or empty.
Autodesk.Revit.Exceptions..::..FileNotFoundExceptionThrown when the file specified does not exist.
Autodesk.Revit.Exceptions..::..ArgumentExceptionThrown when no file is specified or if the file is not a valid gbXML file or does not contain any result elements.

See Also