DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.67k stars 622 forks source link

What's the assumed workflow regarding units? #2428

Closed andydandy74 closed 9 years ago

andydandy74 commented 9 years ago

This issue contains a few wishes / feature requests - but mainly I'd just like to understand the reasoning behind some things regarding units in Dynamo that strike me as odd.

  1. All the nodes that measure lengths, areas or volumes in Dynamo return doubles. If they have to return doubles, shouldn't they at least also return the respective units (*second output+)? getunits
  2. Mathematical operations with units seem to be a very delicate matter: operators In particular, I'd be interested in whether there is a syntax for performing mathematical operations on mixed sets of data (e.g. doubles and lengths) in a CBN. I, for one, couldn't figure it out. Creating complex formulas in a purely node-based workflow is clunky at best and seems to me a rather big step backward.
  3. There do not seem to be any methods for verifying whether a number (e.g. an input value of a custom node) is, for example, a double or a length. As long as mathematical operations with units are so unforgiving, this poses a problem when designing custom node. i think we might need IsLength, IsArea & IsVolume.
  4. My feeling is that due to the issues described above the use of units in Dynamo currently does not really make much sense. The only benefit I see at present is the use of conversion methods when interacting with the Revit API via Python. When pulling data out of the model these methods (FromFeet, FromSquareFeet, FromCubicFeet) work fine. However, when feeding data to the Revit API we would need similar methods that work the other way (ToFeet, ToSquareFeet, ToCubicFeet).

Final question: What is the actual intended use for units in Dynamo? Is there any practical use case besides Revit API interaction that I am missing?

pboyer commented 9 years ago

@ikeough @lukechurch

Hey guys,

The units issue really needs to be addressed. Andreas is correct in bringing it up. It's not very clear and I can't imagine it makes sense to most users even though, in theory, it's relatively simple - Dynamo uses the SI system for all values.

Today, all we really provide is a handful of nodes to do conversions and show numbers in a different unit system. That's fine. This was understood to be a step back from the 0.6.3 feature set.

However, we show unit preferences prominently in the UI, right in the menu system, but these do not format things like Length, Area, or Volume calculations in ProtoGeometry nor is unitized data supported by basic math operations. This is highly confusing and Andreas is right to put together such a long Github issue full of suggestions and criticisms.

Andreas makes good suggestions above, but without substantial modifications (e.g. make all numbers unitized in all libraries and the VM) we are not going to be able to support them.

So, where are we going with this? What concrete changes can we make so that this is not confusing?

~Peter

andydandy74 commented 9 years ago

I just noticed that methods for ToFeet, ToSquareFeet and ToCubicFeet are now available in the 0.7.4 daily builds. Thanks!

andydandy74 commented 9 years ago

Completely redone in 0.8