I have a workflow I’m testing where I’m updating space parameters in a GH script and sending them to Speckle. I calculated the airflow for this parameter in L/s and used the Parameter Updater to send the new value to Speckle. When I pull everything back into Revit, the values are at least two orders of magnitude off. It’s not a straight conversion, either, because they’re not just multiplied by 1000 (my first thought was since the Speckle stream had ‘mm’ as units for some reason, it may have just been the conversion gone wrong, but I switched the units to m and it didn’t fix anything). Has anyone else had experience with trouble-shooting this? I still have no idea what could be causing it or what units the add-in could think the parameter’s being sent in. Any help would be greatly appreciated!
Please see below for my current Revit units, and the data structure in the Speckle stream.
That’s because the ParameterUpdater doesn’t currently let you specify the actual units of the parameter and just takes them from the active Doc.
Therefore when that parameter is received, the connector assumes those are meters (or mm) and converts them to feet (Revit’s internal unit for length).
I’ve just added support for this and will be available in the next release.
You can see that now the Parameter components have an optional Units input.
Here’s how it works (also in our docs):
if using a length based parameter (eg Base Offset) you don’t need to set the units. Speckle will automatically pick the ones sent in the current Rhino document and convert them to Revit (unless you want to override them)
if using a non length based parameter (eg Air FLow) you should set the units to none. Speckle will then simply assume the value used matches the display units being use in Revit (eg L/s) and will not convert them.
Thanks for sharing @daria_ivnc ! Yes, that’s mostly intended for Revit<>Revit as it’s not the most user friendly way to specify units, but it does work