I have extracted the thermal conductivity value from materials in a Python script in Dynamo but it extracts this value in a strange unit. It’s not in the SI units (W/m.K) but I can’t figure out in what unit it is.
Anyone know the internal unit that Revit use for Thermal Conductivity? I know they use some strange units but I have not found it for this parameter.
I don’t know the specifics about the unit type, but have you tried converting the units from internal units to the units you are after? You can use methods from the UnitUtils Class:
import clr
#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
#Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument
#Start scripting here:
mats = [UnwrapElement(i) for i in IN[0]]
name = [i.Name for i in mats]
output = []
for i in mats:
tcid = doc.GetElement(i.ThermalAssetId)
if tcid == None:
output.append('No PropertySet Element')
else:
tc = UnitUtils.ConvertFromInternalUnits(tcid.GetThermalAsset().ThermalConductivity, DisplayUnitType.DUT_WATTS_PER_METER_KELVIN)
output.append(tc)
#Assign your output to the OUT variable.
OUT = name, output
And just out of curiosity, where does Dynamo find this value and why is it in a strange unit? Because in the material properties, all the values are mainly in SI units. Is there not a way to extract directly that value?
If this value was obtained through nodes, then the value should be returned with with the same unit type as your document, but since you go through the API, it will always return built in Revit units, which is imperial.
That said though, it sorta confused me when i was checking this last night. I tried to run the output through various online unit converters, but none of them returned the same value as Revit. It was late, so i gave up since the script retuned what i was after
Perhaps someone with more knowledge about thermal conductivity and imperial units can chip in?