GetThermalAsset Method


Gets a copy of the ThermalAsset.

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

Syntax

C#
public ThermalAsset GetThermalAsset()
Visual Basic
Public Function GetThermalAsset As ThermalAsset
Visual C++
public:
ThermalAsset^ GetThermalAsset()

Examples

Copy C#
private void ReadMaterialThermalProps(Document document, Material material)
{
   ElementId thermalAssetId = material.ThermalAssetId;
   if (thermalAssetId != ElementId.InvalidElementId)
   {
      PropertySetElement pse = document.GetElement(thermalAssetId) as PropertySetElement;
      if (pse != null)
      {
         ThermalAsset asset = pse.GetThermalAsset();

         // Check the thermal material type and only read if solid
         if (asset.ThermalMaterialType == ThermalMaterialType.Solid)
         {

            // Get the properties which are supported in solid type
            bool isTransmitsLight = asset.TransmitsLight;
            double permeability = asset.Permeability;
            double porosity = asset.Porosity;
            double reflectivity = asset.Reflectivity;
            double resistivity = asset.ElectricalResistivity;
            StructuralBehavior behavior = asset.Behavior;

            // Get the other properties.
            double heatOfVaporization = asset.SpecificHeatOfVaporization;
            double emissivity = asset.Emissivity;
            double conductivity = asset.ThermalConductivity;
            double density = asset.Density;
         }
      }
   }
}
Copy VB.NET
Private Sub ReadMaterialThermalProps(document As Document, material As Material)
    Dim thermalAssetId As ElementId = material.ThermalAssetId
    If thermalAssetId <> ElementId.InvalidElementId Then
        Dim pse As PropertySetElement = TryCast(document.GetElement(thermalAssetId), PropertySetElement)
        If pse IsNot Nothing Then
            Dim asset As ThermalAsset = pse.GetThermalAsset()

            ' Check the thermal material type and only read if solid
            If asset.ThermalMaterialType = ThermalMaterialType.Solid Then

                ' Get the properties which are supported in solid type
                Dim isTransmitsLight As Boolean = asset.TransmitsLight
                Dim permeability As Double = asset.Permeability
                Dim porosity As Double = asset.Porosity
                Dim reflectivity As Double = asset.Reflectivity
                Dim resistivity As Double = asset.ElectricalResistivity
                Dim behavior As StructuralBehavior = asset.Behavior

                ' Get the other properties.
                Dim heatOfVaporization As Double = asset.SpecificHeatOfVaporization
                Dim emissivity As Double = asset.Emissivity
                Dim conductivity As Double = asset.ThermalConductivity
                Dim density As Double = asset.Density
            End If
        End If
    End If
End Sub

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 →