SapObject.SapModel.Analyze.RunAnalysis
Function RunAnalysis() As Long
None
This function runs the analysis. The analysis model is automatically created as part of this function.
The function returns zero if the analysis model is successfully run, otherwise it returns a nonzero value.
IMPORTANT NOTE: Your model must have a file path defined before running the analysis. If the model is opened from an existing file, a file path is defined. If the model is created from scratch, the File.Save function must be called with a file name before running the analysis. Saving the file creates the file path.
Sub RunSapAnalysisModel()
'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
'create model from template
ret = SapModel.File.New2DFrame(PortalFrame,
3, 124, 3, 200)
'save model
ret = SapModel.File.Save("C:\SapAPI\x.sdb")
'run model (this will create the analysis model)
ret = SapModel.Analyze.RunAnalysis
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Initial release in version 11.00.
BridgeObj.SetBridgeUpdateForAnalysisFlag