WorkflowUnits

WorkflowUnits

Helper functions to get factors to convert between unit systems

Constructor

new WorkflowUnits()

Source:

Methods

(static) ForceToKiloNewtonFactor(unit_system) → {number}

Description:
  • Returns a factor to divide a force value by to convert it from the given unit system to kN (or multiply by to convert from kN to the given unit system)
Source:
Example
let force = 1000.0;  // 1000 N
let f = WorkflowUnits.ForceToKiloNewtonFactor(Workflow.UNIT_SYSTEM_U1);
let kn = force / f;  // kn = 1000 / 1000 = 1
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
number

(static) GravityConstant(unit_system) → {number}

Description:
  • Return the gravity constant for the given unit system
Source:
Example
let g = WorkflowUnits.GravityConstant(Workflow.UNIT_SYSTEM_U1);
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
number

(static) LengthToMetresFactor(unit_system) → {number}

Description:
  • Returns a factor to divide a length value by to convert it from the given unit system to metres (or multiply by to convert from metres to the given unit system)
Source:
Example
let mm = 1500;  // 1500mm
let f = WorkflowUnits.LengthToMetresFactor(Workflow.UNIT_SYSTEM_U2);
let metres = mm / f;  // metres = 1500 / 1000 = 1.5
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
number

(static) LengthToMillimetresFactor(unit_system) → {number}

Description:
  • Returns a factor to divide a length value by to convert it from the given unit system to millimetres (or multiply by to convert from millimetres to the given unit system)
Source:
Example
let mm = 1500;  // 1500mm
let f = WorkflowUnits.LengthToMillimetresFactor(Workflow.UNIT_SYSTEM_U2);
let metres = mm / f;  // metres = 1500 / 1000 = 1.5
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
number

(static) LengthUnit(unit_system) → {string}

Description:
  • Get the length unit for the given unit system
Source:
Example
let u = WorkflowUnits.LengthUnit(Workflow.UNIT_SYSTEM_U1);
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
string

(static) MassToKilogramsFactor(unit_system) → {number}

Description:
  • Returns a factor to divide a mass value by to convert it from the given unit system to kilograms (or multiply by to convert from kilograms to the given unit system)
Source:
Example
let tonne = 1.0;  // 1 tonne
let f = WorkflowUnits.MassToKilogramFactor(Workflow.UNIT_SYSTEM_U2);
let kg = tonne / f;  // kg = 1.0 / 0.001 = 1000
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
number

(static) MassUnit(unit_system) → {string}

Description:
  • Get the mass unit for the given unit system
Source:
Example
let u = WorkflowUnits.MassUnit(Workflow.UNIT_SYSTEM_U1);
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
string

(static) MomentToNewtonMetreFactor(unit_system) → {number}

Description:
  • Returns a factor to divide a moment value by to convert it from the given unit system to Nm (or multiply by to convert from Nm to the given unit system)
Source:
Example
let moment = 1000.0;  // 1000 Nmm
let f = WorkflowUnits.MomentToNewtonMetreFactor(Workflow.UNIT_SYSTEM_U2);
let kNm = moment / f;  // Nm = 1000 / 1000 = 1
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
number

(static) TimeToSecondsFactor(unit_system) → {number}

Description:
  • Returns a factor to divide a time value by to convert it from the given unit system to seconds (or multiply by to convert from seconds to the given unit system)
Source:
Example
let ms = 1000;  // 1000ms
let f = WorkflowUnits.TimeToSecondsFactor(Workflow.UNIT_SYSTEM_U3);
let s = ms / f;  // s = 1000 / 1000 = 1.0
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
number

(static) TimeUnit(unit_system) → {string}

Description:
  • Get the time unit for the given unit system
Source:
Example
let u = WorkflowUnits.TimeUnit(Workflow.UNIT_SYSTEM_U1);
Parameters:
Name Type Description
unit_system number Workflow unit system, e.g. Workflow.UNIT_SYSTEM_U1
Returns:
Type
string