I have a problem with Space Parameters.
I would like to get parameter values of “Design Heating Load” in Dynamo.
As you can see from the picture below, the Space OFFICE 01 has the parameter “Design Heating Load” equal to 237 W.
If I want to get that parameter to all the space with Dynamo, the values are wrong.
Do you know why?
There have been some improvements in Dynamo recently with units- such as length, volume etc
But it seems this parameter is being reported in different units
I have an idea that the Lunchbox node reported it in current units- but it doesn’t seem to work.
It should be pretty easy to convert the reported value to correct units
Are you using the latest Lunchbox package from package manager?
Older version will not work in 1.2.
Yes, my Lunchbox is up to date.
I did notice Parameter.ParameterByName reports the correct units
I’ll try the other option & report back
… or the old conversion approach
@Kulkul is right , AsValueString will get your aroud the unit conversion issues. Revit internally works with some units that can not be changed.
You could also use the following code if you’d like to run conversions from/to the internal units:
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
#Getting Document UI Units - you nedd to precise the unit type, here it's lenght
UIunit = Document.GetUnits(doc).GetFormatOptions(UnitType.UT_Length).DisplayUnits
#Converting Input to internal units to user interface units
convertto = UnitUtils.ConvertToInternalUnits(IN,UIunit)
#Converting Input from internal units to user interface units
convertfrom = UnitUtils.ConvertFromInternalUnits(IN,UIunit)
OUT = convertto , convertfrom
List of all unit types here :
Thanks to all of you guys.
There is more than one solution for my query.
Now I understand why I had this problem.