# Unit number parameter

WARNING

GSA-Grasshopper plugin [GSA-GH] is pre-release and under active development, including further testing to be undertaken. It is provided "as-is" and you bear the risk of using it. Future versions may contain breaking changes. Any files, results, or other types of output information created using GSA-GH should not be relied upon without thorough and independent checking.

Icon
UnitNumber

# Description

GSA-GH includes a new way to work with units inside Grasshopper; we call this parameter a UnitNumber. For components that are using UnitNumber as input parameter you can typically simply input a number like you are used to and the component will automatically convert it into the selected unit on the component or the default unit set in the plugin settings.

A UnitNumber is technically a Quantity defined as: Quantity = Value (number) x Measure (unit).

We are using the open source library UnitsNet (opens new window) and extended by Oasys with engineering units.

# Create unit number

The following units have been exposed (many more are available in UnitsNet, let us know if you need them exposed...):

  • Length
  • Force
  • Moment
  • Stress
  • Strain
  • Temperature
  • Mass
  • Velocity
  • Acceleration
  • Time
  • AxialStiffness
  • BendingStiffness
  • Curvature

As mentioned, most components having UnitNumber inputs will also have a dropdown for you to select the unit . You can input a normal slider component to create a UnitNumber input of the selected unit, or you can use the Create UnitsNumber component to create (and mix) your own: CreateUnitNumber

# Convert unit number

Aside from creating a Unit Number from scratch, you can also convert a UnitNumber between units of the same type. This is handy for results that you may want to convert into a more familiar unit.

ConvertUnitNumber