AGI STK Util 11Send comments on this topic.
GetCurrentUnitAbbrv Method (IAgUnitPrefsDimCollection)
See Also
IndexOrDimName
The index or dimension name
Windows






Windows & Linux

Description

Returns the Current Unit for a Dimension.

Syntax

[Visual Basic .NET]
Public Function GetCurrentUnitAbbrv( _
    ByVal IndexOrDimName As System.Object _
) As 
[C#]
public string GetCurrentUnitAbbrv(
    System.Object IndexOrDimName
);
[Managed C++]
public: String __gc ^ GetCurrentUnitAbbrv(
    VARIANT IndexOrDimName
);
[Java]
public String getCurrentUnitAbbrv(
    VARIANT IndexOrDimName
);
[Unmanaged C++]
public: HRESULT GetCurrentUnitAbbrv(
    VARIANT IndexOrDimName,
    BSTR * pUnitAbbrv
);

Parameters

IndexOrDimName
The index or dimension name

Return Type

Returns the current unit abbreviation for the given index.

See Also

Example

[Visual Basic .NET]
Dim oSTK As Object      
Dim oStkObjectRoot As AGI.STKObjects.AgStkObjectRoot
Dim distanceUnit As String

Dim oType As Type = Type.GetTypeFromProgID("STK.Application")
oSTK = Activator.CreateInstance(oType)

oStkObjectRoot = oSTK.GetType().InvokeMember( _
"Personality2", _
System.Reflection.BindingFlags.GetProperty, _
Nothing, _
oSTK, _
Nothing)

distanceUnit = oStkObjectRoot.UnitPreferences.GetCurrentUnitAbbrv("DistanceUnit")

MessageBox.Show(distanceUnit)

oStkObjectRoot = Nothing
oSTK = Nothing
Get a current unit preference
[C#]
// DistanceUnit
string dimensionName = "Distance";
string unitAbbreviation = root.UnitPreferences.GetCurrentUnitAbbrv(dimensionName);
Get a current unit preference
[Visual Basic .NET]
' DistanceUnit
Dim dimensionName As String = "Distance"
Dim unitAbbreviation As String = root.UnitPreferences.GetCurrentUnitAbbrv(dimensionName)
© 2019 Analytical Graphics, Inc. All Rights Reserved.