SapObject.ApplicationExit
Function ApplicationExit(ByVal FileSave As Boolean) As Long
FileSave
If this item is True the existing model file is saved prior to closing Sap2000.
If the model file is saved then it is saved with its current name. You should set the Sap2000 object variable to nothing after calling this function.
This function returns zero if the function succeeds and nonzero if it fails.
Sub ExitExample()
'dimension variables
Dim SapObject As Sap2000.SapObject
Dim SapModel As cSapModel
Dim ret as Long
'create Sap2000 object
Set SapObject = New SAP2000.SapObject
'start Sap2000 application
SapObject.ApplicationStart
'create SapModel object
Set SapModel = SapObject.SapModel
'initialize model
ret = SapModel.InitializeNewModel(kip_ft_F)
'create a 3D frame model from template
ret = SapModel.File.New3DFrame(BeamSlab,
3, 12, 3, 28, 2, 36)
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Initial release in version 11.00.