Export Method (String, String, GBXMLExportOptions)

Export the model in gbXML (green-building) format.

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


public bool Export(
	string folder,
	string name,
	GBXMLExportOptions options
Visual Basic
Public Function Export ( _
	folder As String, _
	name As String, _
	options As GBXMLExportOptions _
) As Boolean
Visual C++
bool Export(
	String^ folder, 
	String^ name, 
	GBXMLExportOptions^ options


Type: System String
Indicates the path of a folder where to export the gbXML file.
Type: System String
Indicates the name of the gbXML file to export. If it doesn't end with ".xml", extension ".xml" will be added automatically. The name cannot contain any of the following characters: \/:*?"<>|. Empty name is not acceptable.
Type: Autodesk.Revit.DB GBXMLExportOptions
Options which control the contents of the export.

Return Value

True if successful, otherwise False.


This export operation will operate on the main EnergyAnalysisDetailModel in the document, if it exists (see EnergyAnalysisDetailModel.GetMainEnergyAnalysisDetailModel()). If it does not exist, or if the requested ExportEnergyModelType does not match the type of the main EnergyAnalysisDetailModel, this function will fail. If you need to export a model with different settings or type than the current main energy model in the document, you should delete the current main energy model, update the EnergyAnalysisSettings, and regenerate the energy model. If the EnergyDataSettings is set to use conceptual models, this function cannot be used. Instead use [!:Autodesk::Revit::DB::Document::Export(String, String, MassGBXMLExportOptions)] .


Exception Condition
Autodesk.Revit.Exceptions ArgumentException The path is not valid for exporting gbXML files. -or- The name is empty or not valid for exporting gbXML files. -or- Analysis type is invalid. For AnalysisMode.ConceptualMasses, use Document.Export(String, String, MassGBXMLExportOptions). -or- There is no main EnergyAnalysisDetailModel in the document, or the current main EnergyAnalysisDetailModel is not compatible with the option set in the GBXMLExportOptions.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException Exporting is not allowed in the current application mode. -or- Export is temporarily disabled.

See Also