SapObject.ApplicationStart
Function ApplicationStart(Optional ByVal Units As eUnits = kip_in_F, Optional ByVal Visible As Boolean = True, Optional ByVal FileName As String = "") As Long
Units
The database units used when a new model is created. Data is internally stored in the program in the database units. The database units may be 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
Visible
If this item is True then the application is visible when started. If it is False then the application is hidden when started.
FileName
The full path of a model file to be opened when the Sap2000 application is started. If no file name is specified, the application starts without loading an existing model.
This function starts the Sap2000 application.
When the model is not visible it does not appear on screen and it does not appear in the Windows task bar.
If no filename is specified, you can later open a model or create a model through the API.
The file name must have an .sdb, .$2k, .s2k, .xls, or .mdb extension. Files with .sdb extensions are opened as standard SAP2000 files. Files with .$2k and .s2k extensions are imported as text files. Files with .xls extensions are imported as Microsoft Excel files. Files with .mdb extensions are imported as Microsoft Access files.
This function returns zero if the application successfully starts and nonzero if it fails.
Sub StartExample()
'dimension variables
Dim SapObject as SAP2000.SapObject
Dim
ret as Long
'create Sap2000 object
Set SapObject = New SAP2000.SapObject
'start Sap2000 application
ret = SapObject.ApplicationStart
'close Sap2000
SapObject.ApplicationExit False
Set SapObject = Nothing
End Sub
Initial release in version 11.00.