Description | Example | Return Message | Group

Units_Convert

Convert a value from one unit to another.

Syntax

Units_Convert <ScenarioPath> {Date | Unit} <Parameters>

Related Commands

Description

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.

Example

To convert a gregorian date to YYYY:MM:DD:

Units_Convert * Date GregorianUTC YYYY:MM:DD "1 Jul 2005 12:00:00.000"

ReturnMessage

2005:07:01:12:00:00.000

Example

To convert a distance from meters to kilofeet:

Units_Convert * Unit Distance Meter kilofeet 152.32

ReturnMessage

0.499738

Example

To convert an angle from degrees to arc seconds:

Units_Convert * Unit Angle DEGREE "Arc Seconds" 25.3

ReturnMessage

91080.000000

ReturnMessage

If activated, Connect returns an acknowledgement message.

Group Membership

This command belongs to the following group(s):

Scenarios

Version

10.1

STK Programming Interface 11.0.1