Revit 2025 API
DocumentImport(String, GBXMLImport |
Imports a Green-Building XML file into the document.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public bool Import( string file, GBXMLImportOptions options )
Public Function Import ( file As String, options As GBXMLImportOptions ) As Boolean
public: bool Import( String^ file, GBXMLImportOptions^ options )
member Import : file : string * options : GBXMLImportOptions -> bool
Parameters
- file String
- Full path of the file to import. File must exist.
- options GBXMLImportOptions
- Various options applicable to GBXml import. If , all options will be set to their respective default values.
Return Value
BooleanTrue if successful, otherwise False.

Exception | Condition |
---|---|
ArgumentNullException | Thrown when file argument is or empty. |
FileNotFoundException | Thrown when the file specified does not exist. |
ArgumentException | Thrown when no file is specified or if the file is not a valid gbXML file or does not contain any result elements. |

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