STK UtilSend comments on this topic.
SetCurrentUnit Method (IAgUnitPrefsDim)
See Also
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 _
) As 
[C#]
public void SetCurrentUnit(
    string UnitAbbrv
);
[Managed C++]
public: void SetCurrentUnit(
    String __gc ^ UnitAbbrv
);
[Java]
public void setCurrentUnit(
    String UnitAbbrv
);
[Unmanaged C++]
public: HRESULT SetCurrentUnit(
    BSTR UnitAbbrv
);

Parameters

UnitAbbrv
The unit abbreviation to set for the dimension.

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)

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

oStkObjectRoot = Nothing
oSTK = Nothing
© 2020 Analytical Graphics, Inc. All Rights Reserved.