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:
Detailed DescriptionThe Units class is used to define the units for each axis of a curve: |
p.x_axis_units = Units.LENGTH
Details of functionsGetDisplayUnits()DescriptionReturns the Display units |
No arguments
ReturnsString indicating the display unit system Return typeString |
ExampleTo get the display units var units = Units.GetDisplayUnits();
|
SetDisplayUnits(unit system[String])DescriptionSets the display units to the units provided by the user |
The unit system you want to set the display units to
ReturnsTRUE if the Display units are set successfully else FALSE Return typeBoolean |
ExampleTo set the display units to "U2" Units.SetDisplayUnits("U2");
|
USER(mass[real], time[real], length[real], angle[real], temperature[real], current (optional)[real]) [static]DescriptionSetup a user defined UNIT |
Power for mass dimensions.
Power for time dimensions.
Power for length dimensions.
Power for angle dimensions.
Power for temperature dimensions.
Power for current dimensions.
Returnsinteger Return typeNumber |
ExampleTo 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);
|