SapObject.SapModel.File.Save
Function FileSave(Optional ByVal FileName As String = "") As Long
FileName
The full path to which the model file is saved.
If a file name is specified, it should have an .sdb extension. If no file name is specified, the file is saved using its current name.
If there is no current name for the file (the file has not been saved previously) and this function is called with no file name specified, an error will be returned.
This function returns zero if the file is successfully saved and nonzero if it is not saved.
Sub SaveSDB()
'dimension variables
Dim SapObject As Sap2000.SapObject
Dim SapModel As cSapModel
Dim FileName as String
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
'start a new template model
ret = SapModel.File.New2DFrame(PortalFrame,
3, 124, 3, 200)
'save SDB file
ret=SapModel.File.Save("C:\SapAPI\x.sdb")
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Initial release in version 11.00.