STK UtilSend comments on this topic.
ConvertQuantityArray Method (IAgConversionUtility)
See Also
DimensionName
FromUnit
ToUnit
QuantityValues
Windows





Windows & Linux

Description

Converts the specified quantity values from a given unit to another unit.

Syntax

[Visual Basic .NET]
Public Function ConvertQuantityArray( _
    ByVal DimensionName As String, _
    ByVal FromUnit As String, _
    ByVal ToUnit As String, _
    ByVal QuantityValues As System.Array _
) As System.Array
[C#]
public System.Array ConvertQuantityArray(
    string DimensionName,
    string FromUnit,
    string ToUnit,
    System.Array QuantityValues
);
[Managed C++]
public: System::Array ConvertQuantityArray(
    String __gc ^ DimensionName,
    String __gc ^ FromUnit,
    String __gc ^ ToUnit,
    System::Array ^ QuantityValues
);
[Unmanaged C++]
public: HRESULT ConvertQuantityArray(
    BSTR DimensionName,
    BSTR FromUnit,
    BSTR ToUnit,
    SAFEARRAY * * QuantityValues,
    SAFEARRAY * * ppConvertedQuantityValues
);
[Java]
public AgSafeArray convertQuantityArray(
    String DimensionName,
    String FromUnit,
    String ToUnit,
    AgSafeArray QuantityValues
);
[Python - STK API ]
def ConvertQuantityArray(self, DimensionName:str, FromUnit:str, ToUnit:str, QuantityValues:list) -> list:

Parameters

DimensionName
FromUnit
ToUnit
QuantityValues

See Also

Example

Convert mulitple quantities of the same unit to another unit
[C#]
IAgConversionUtility converter = root.ConversionUtility;

// ConvertQuantityArray expects a one dimensional array of values to be converted
// An array of km/sec units
Array kmsecUnits = new object[]
                   {
                       100, 23
                   };

// Convert to mi/sec units
// ConvertQuantityArray returns a one dimensional array of converted values
Array misecUnits = converter.ConvertQuantityArray("Rate", "km/sec", "mi/sec", ref kmsecUnits);
Convert mulitple quantities of the same unit to another unit
[Visual Basic .NET]
Dim converter As IAgConversionUtility = root.ConversionUtility

' ConvertQuantityArray expects a one dimensional array of values to be converted
' An array of km/sec units
Dim kmsecUnits As Array = New Object() {100, 23}

' Convert to mi/sec units
' ConvertQuantityArray returns a one dimensional array of converted values
Dim misecUnits As Array = converter.ConvertQuantityArray("Rate", "km/sec", "mi/sec", kmsecUnits)
© 2024 Analytical Graphics, Inc. All Rights Reserved.