AGI STK Util 11Send comments on this topic.
SetCurrentUnit Method (IAgUnitPrefsDim)
See Also  Example
UnitAbbrv
The unit abbreviation to set for the dimension.
Windows






Windows & Linux

Description

Method to set unit preferences.

Syntax

[Visual Basic .NET]
Public Sub SetCurrentUnit( _
   ByVal UnitAbbrv As String _
) 
[C#]
public void SetCurrentUnit(
   string UnitAbbrv
);
[Managed C++]
public: void SetCurrentUnit(
   String __gc ^ UnitAbbrv
);
[Java]
public  setCurrentUnit(
   String UnitAbbrv
);
[Unmanaged C++]
public: HRESULT SetCurrentUnit(
   BSTR UnitAbbrv
);

Parameters

UnitAbbrv
The unit abbreviation to set for the dimension.

Example

[Visual Basic .NET]Copy Code
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)

oStkObjectRoot.UnitPreferences("DistanceUnit").SetCurrentUnit("m")

oStkObjectRoot = Nothing
oSTK = Nothing

See Also

© 2018 Analytical Graphics, Inc. All Rights Reserved.