Convert a value from one unit to another.
Units_Convert <ScenarioPath> {Date | Unit} <Parameters>
The Units_Convert command is used to convert a value from one unit to a different unit within a dimension.
The format of the Units_Convert Date is as follows:
Units_Convert <ScenarioPath> Date {FromUnit} {ToUnit} "<InputValue>"
The format of the Units_Convert Unit is as follows:
Units_Convert <ScenarioPath> Unit {DimensionName} {FromUnit} {ToUnit} "<InputValue>"
The following table describes the command parameters.
Parameter | Description |
---|---|
{DimensionName} | Enter the dimension of the value being converted. (Not valid for Units_Convert Date command.) |
{FromUnit} | Enter the unit name or abbreviation of the <InputValue>. |
{ToUnit} | Enter the unit name or abbreviation that the <InputValue> will be converted to. |
<InputValue> | The value being converted. |
Any {FromUnit}, {ToUnit}, or <InputValue> that contains spaces must be enclosed in double quotes.
Use the Units_Get command to get the available dimensions and current unit settings for those dimensions.
Use the Units_Get command with the UnitNames option to get valid unit names for a specified dimension.
To convert a gregorian date to YYYY:MM:DD:
Units_Convert * Date GregorianUTC YYYY:MM:DD "1 Jul 2005 12:00:00.000"
2005:07:01:12:00:00.000
To convert a distance from meters to kilofeet:
Units_Convert * Unit Distance Meter kilofeet 152.32
0.499738
To convert an angle from degrees to arc seconds:
Units_Convert * Unit Angle DEGREE "Arc Seconds" 25.3
91080.000000
If activated, Connect returns an acknowledgement message.
This command belongs to the following group(s):
10.1
STK Programming Interface 11.0.1