Energy Data

Energy Data

The EnergyDataSettings object represents the gbXML Parameters in the Revit project. To view the parameters, from the Revit UI, select Project Information from the Project Settings panel on the Manage tab. The Project Information dialog box appears.

Figure 153: EnergyDataSettings

The EnergyDataSettings object is derived from the Element base object. It is unique in each project, similar to ProjectInformation. Though EnergyDataSettings is a subclass of the Element class, most of the members inherited from the Element return null or an empty set except for Name, Id, UniqueId, and Parameters.

The following code sample uses the EnergyDataSettings class. The result appears in a TaskDialog after invoking the command.

Code Region 28-7: Using the EnergyDataSettings class

public void GetInfo_EnergyData(Document document)
{
        EnergyDataSettings energyData = EnergyDataSettings.GetFromDocument(document);

        if (null != energyData)
        {
                string message = "energyData : ";
                message += "\nBuildingType : " + energyData.BuildingType;
                TaskDialog.Show("Revit", message);
        }
}