Units class

The Units class contains constants relating to curve units. More...

The T/HIS JavaScript API provides many class constants, properties and methods. For Arup to be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:

Class functions

Member functions

Units constants

Name Description
Units.ACCELERATION Acceleration units
Units.AREA Area units
Units.CHARGE Charge units
Units.CONDUCTIVITY Conductivity units
Units.CURRENT Current units
Units.DENSITY Density units
Units.DISPLACEMENT Displacement units
Units.ELECTRIC_FIELD_VECTOR Electric Field Vector units
Units.ENERGY Energy units
Units.ENERGY_DENSITY Energy Density units
Units.FLOW_RATE Flow Rate units
Units.FLUX Thermal Flux units
Units.FORCE Force units
Units.FORCE_WIDTH Force per unit width units
Units.FREQUENCY Frequency units
Units.HEAT_TRANSFER_COEFF Heat Transfer coefficient units
Units.INDUCTANCE Inductance units
Units.INERTIA Inertia units
Units.LENGTH Length units
Units.MAGNETIC_FLUX_VECTOR Magnetic Flux Vector units
Units.MASS MAss units
Units.MASS_FLOW Mass Flow rate units
Units.MOMENT Moment units
Units.MOMENTUM Momentum units
Units.MOMENT_WIDTH Moment per unit width units
Units.NONE No units
Units.POWER Power units
Units.PRESSURE Pressure units
Units.Q_CRITERION Q Criterion units
Units.RESISTANCE Resistance units
Units.ROTATION Rotation units
Units.ROTATIONAL_ACCELERATION Rotational Acceleration units
Units.ROTATIONAL_VELOCITY Rotational Velocity units
Units.STRAIN Strain units
Units.STRESS Stress units
Units.TEMPERATURE Temperature units
Units.THERMAL_DIFFUSIVITY Thermal Diffusivity units
Units.TIME Time units
Units.UNKNOWN Unknown units
Units.VECTOR_POTENTIAL Vector Potential units
Units.VELOCITY Velocity units
Units.VISCOSITY Viscosity units
Units.VOLTAGE Voltage units
Units.VOLUME Volume units
Units.VORTICITY Vorticity units
Units.WORK Work units

Detailed Description

The Units class is used to define the units for each axis of a curve:

p.x_axis_units = Units.LENGTH
      

Details of functions

GetDisplayUnits()

Description

Returns the Display units

Arguments

No arguments

Returns

String indicating the display unit system

Return type

String

Example

To get the display units

var units = Units.GetDisplayUnits();


SetDisplayUnits(unit system[String])

Description

Sets the display units to the units provided by the user

Arguments

  • unit system (String)

    The unit system you want to set the display units to

    Returns

    TRUE if the Display units are set successfully else FALSE

    Return type

    Boolean

    Example

    To set the display units to "U2"

    Units.SetDisplayUnits("U2");


    USER(mass[real], time[real], length[real], angle[real], temperature[real], current (optional)[real]) [static]

    Description

    Setup a user defined UNIT

    Arguments

  • mass (real)

    Power for mass dimensions.

  • time (real)

    Power for time dimensions.

  • length (real)

    Power for length dimensions.

  • angle (real)

    Power for angle dimensions.

  • temperature (real)

    Power for temperature dimensions.

  • current (optional) (real)

    Power for current dimensions.

    Returns

    integer

    Return type

    Number

    Example

    To set the y-axis unit of curve l to (m/s)^2:

    l.y_unit = Units.USER(0.0,2.0,-2.0,0.0,0.0,0.0);