SetPresentUnits

SetPresentUnits

Syntax

SapObject.SapModel.SetPresentUnits

VB6 Procedure

Function SetPresentUnits(ByVal Units As eUnits) As Long

Parameters

Units

One of the following items in the eUnits enumeration:

lb_in_F = 1

lb_ft_F = 2

kip_in_F = 3

kip_ft_F = 4

kN_mm_C = 5

kN_m_C = 6

kgf_mm_C = 7

kgf_m_C = 8

N_mm_C = 9

N_m_C = 10

Ton_mm_C = 11

Ton_m_C = 12

kN_cm_C = 13

kgf_cm_C = 14

N_cm_C = 15

Ton_cm_C = 16

Remarks

This function returns zero if the units are successfully set and nonzero if they are not set.

VBA Example

Sub SetUnitsPresent()

'dimension variables

Dim SapObject as cOAPI

Dim SapModel As cSapModel

Dim FileName As String

Dim ret As Long

'create Sap2000 object

Set SapObject = CreateObject("CSI.SAP2000.API.SapObject")

'start Sap2000 application

SapObject.ApplicationStart

'create SapModel object

Set SapModel = SapObject.SapModel

'initialize model

ret = SapModel.InitializeNewModel

'start a new template model

ret = SapModel.File.New2DFrame(ConcentricBraced, 3, 124, 3, 200)

'set present units to KN-m

ret = SapModel.SetPresentUnits(KN_m_C)

'close Sap2000

SapObject.ApplicationExit False

Set SapModel = Nothing

Set SapObject = Nothing

End Sub

Release Notes

Initial release in version 11.00.

See Also

GetDatabaseUnits

GetPresentUnits