GetDatabaseUnits

GetDatabaseUnits

Syntax

SapObject.SapModel.GetDatabaseUnits

VB6 Procedure

Function GetDatabasetUnits() As eUnits

Parameters

None

Remarks

This function returns one of the following items from the eUnits enumeration indicating the database units for the model. All data is internally stored in the model in these units and converted to the present units as needed.

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

VBA Example

Sub GetUnitsDatabase()

'dimension variables

Dim SapObject as cOAPI

Dim SapModel As cSapModel

Dim ret As Long

Dim MyUnits As eUnits

'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(PortalFrame, 3, 124, 3, 200)

'get database units

MyUnits = SapModel.GetDatabaseUnits

'close Sap2000

SapObject.ApplicationExit False

Set SapModel = Nothing

Set SapObject = Nothing

End Sub

Release Notes

Initial release in version 11.00.

See Also

SetPresentUnits

GetPresentUnits