You are on page 1of 1

Sub GetJointDisplacements() 'dimension variables Dim SapObject As Sap2000.

SapObject Dim SapModel As cSapModel Dim ret As Long Dim NumberResults As Long Dim Obj() As String Dim Elm() As String Dim LoadCase() As String Dim StepType() As String Dim StepNum() As Double Dim U1() As Double Dim U2() As Double Dim U3() As Double Dim R1() As Double Dim R2() As Double Dim R3() As Double '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) 'run analysis ret = SapModel.File.Save("C:\SapAPI\x.sdb") ret = SapModel.Analyze.RunAnalysis 'clear all case and combo output selections ret = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput 'set case and combo output selections ret = SapModel.Results.Setup.SetCaseSelectedForOutput("DEAD") 'get point displacements ret = SapModel.Results.JointDispl("ALL", GroupElm, NumberResults, Obj, Elm , LoadCase, StepType, StepNum, U1, U2, U3, R1, R2, R3) 'close Sap2000 SapObject.ApplicationExit False Set SapModel = Nothing Set SapObject = Nothing End Sub

You might also like