Description | Example | Return Message | Group

ConvertUnit

Convert a value from one unit to another. (Deprecated Command)

Syntax

ConvertUnit <ScenarioPath> {Dimension} {InputUnitID} {OuputUnitID} <InputValue>

ATTENTION: THIS COMMAND IS DEPRECATED and has been replaced by:

Units_Convert

Description

Note: This command was deprecated in STK 10.1, it should no longer be used. This command has been replaced by the Units_Convert command.

The ConvertUnit command converts the <InputValue> from {InputUnitID} to {OutputUnitID}. The {InputUnitID} and {OutputUnitID} must be of the same dimension.

Note: {Dimension} and {UnitID} values are NOT case-sensitive.

Note: To convert dates from one format to another use the ConvertDate command.

For a list of all valid {Dimension} and {UnitID} values see the SetGUIUnits command.

Parameter Description
{Dimension} Enter the dimension of the value being converted.
{InputUnitID} Enter the unit ID of the <InputValue>.
{OuputUnitID} Enter the unit ID that the <InputValue> will be converted to.
<InputValue> The value being converted.

Example

To convert a time value from seconds (14400.0) to hours (4):

ConvertUnit * Time Second Hour 14400.0

To convert a distance value from kilometers (300.0) to astronomical (0.000002):

ConvertUnit * DISTANCE Kilometers AU 300.0

To convert a latitude value from DEG:MIN:SEC (23:00:00) to radians (0.4014257279586958000000000):

ConvertUnit * Latitude DEG:MIN:SEC Rad 23:00:00

ReturnMessage

A typical return message for a converted unit is as follows:
CONVERTUNIT 8
4.000000

Group Membership

This command belongs to the following group(s):

Scenarios

Deprecated Commands

Version

10.1

STK Programming Interface 11.0.1