Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

OAPI SAP2000 - Time history displacements step-by-step

Status
Not open for further replies.

asanchezlc

Civil/Environmental
Jan 18, 2023
2
0
0
ES
Hello,

I've had problems for obtaining step-by-step displacements for time history analysis (and also other people has struggled with that:
Following OAPI documentation, normal code (in python) would be something like:

-------------------------------------------------------------------------------------
#Set step-by-step option
Step_by_Step = 2
ret = SapModel.Results.Setup.SetOptionDirectHist(Step_by_Step)

#Select load case (in my case, 'Dynamic')
ret = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret = SapModel.Results.Setup.SetCaseSelectedForOutput('Dynamic')

#Displacement obtention
NumberResults = 0
Obj = []
Elm = []
ACase = ['Dynamic']
StepType = []
StepNum = []
U1 = []
U2 = []
U3 = []
R1 = []
R2 = []
R3 = []
ObjectElm = 0
PointName2 = '2'
[NumberResults, Obj, Elm, ACase, StepType, StepNum, U1, U2, U3, R1, R2, R3, ret] = SapModel.Results.JointDispl(PointName2, ObjectElm, NumberResults, Obj, Elm, ACase, StepType, StepNum, U1, U2, U3, R1, R2, R3)
-------------------------------------------------------------------------------------

Nevertheless, I only could obtain Max and Min displacement. The way of solving it I found is changing modify/show options in show tables.
From OAPI it can be done as follows:

-------------------------------------------------------------------------------------
Envelopes = 1
Step_by_Step = 2

BaseReactionGX = 0
BaseReactionGY = 0
BaseReactionGZ = 0
IsAllModes = True
StartMode = 1
EndMode = 12
IsAllBucklingModes = True
StartBuckingMode = 1
EndBucklingMode = 12
ModalHistory = Step_by_Step
DirectHistory = Step_by_Step
NonLinearStatic = Step_by_Step
MultistepStaticStatic = Step_by_Step
SteadyState = Envelopes
SteadyStateOption = 1
PowerSpectralDensity = 1
Combo = 1
BridgeDesing = 1

ret = SapModel.DatabaseTables.SetTableOutputOptionsForDisplay(BaseReactionGX, BaseReactionGY, BaseReactionGZ, IsAllModes, StartMode, EndMode, IsAllBucklingModes, StartBuckingMode, EndBucklingMode, ModalHistory, DirectHistory, NonLinearStatic, MultistepStaticStatic, SteadyState, SteadyStateOption, PowerSpectralDensity, Combo, BridgeDesing)
-------------------------------------------------------------------------------------

So, putting both codes together it should work! I hope it will be useful!

Greetings
 
Status
Not open for further replies.
Back
Top