Moam93
Civil/Environmental
- May 1, 2020
- 14
I am trying to change the scale factor of response spectrum to be 100 % of base reactions of equavlient static in both x& y direction using APIs in Python
I managed to extract base reaction from spec and equavlient static in both directions . I am stuck in getting scale factor already in model and compare it set it to be new scale based (100% of equavlient static ) for both x and y direction . below is the vode I have written so far .Also attached my code . any help? python file also attached
def scaling (model):
""" Retrieves base reactions from EQ,SPEC in the model."""
ret1 = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret1 = SapModel.Results.Setup.SetCaseSelectedForOutput("EQX")
ret1 = SapModel.Results.BaseReact()
ret2 = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret2 = SapModel.Results.Setup.SetCaseSelectedForOutput("EQY")
ret2 = SapModel.Results.BaseReact()
ret3 = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret3 = SapModel.Results.Setup.SetCaseSelectedForOutput("SPECX")
ret3 = SapModel.Results.BaseReact()
ret4 = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret4 = SapModel.Results.Setup.SetCaseSelectedForOutput("SPECY")
ret4 = SapModel.Results.BaseReact()
get_scale_factor = SapModel.CaseResponseSpectrum.GetLoads("SPECX")
scale_factor = get_scale_factor[3]
FXeq = ret1[4]
FYeq = ret2[5]
FX_spec = ret3[4]
FY_spec = ret4[5]
print("FX_eq",FXeq)
print("FY_eq",FYeq)
print("FX_spec",FX_spec)
print("FY_spec",FY_spec)
]
I managed to extract base reaction from spec and equavlient static in both directions . I am stuck in getting scale factor already in model and compare it set it to be new scale based (100% of equavlient static ) for both x and y direction . below is the vode I have written so far .Also attached my code . any help? python file also attached
def scaling (model):
""" Retrieves base reactions from EQ,SPEC in the model."""
ret1 = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret1 = SapModel.Results.Setup.SetCaseSelectedForOutput("EQX")
ret1 = SapModel.Results.BaseReact()
ret2 = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret2 = SapModel.Results.Setup.SetCaseSelectedForOutput("EQY")
ret2 = SapModel.Results.BaseReact()
ret3 = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret3 = SapModel.Results.Setup.SetCaseSelectedForOutput("SPECX")
ret3 = SapModel.Results.BaseReact()
ret4 = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput()
ret4 = SapModel.Results.Setup.SetCaseSelectedForOutput("SPECY")
ret4 = SapModel.Results.BaseReact()
get_scale_factor = SapModel.CaseResponseSpectrum.GetLoads("SPECX")
scale_factor = get_scale_factor[3]
FXeq = ret1[4]
FYeq = ret2[5]
FX_spec = ret3[4]
FY_spec = ret4[5]
print("FX_eq",FXeq)
print("FY_eq",FYeq)
print("FX_spec",FX_spec)
print("FY_spec",FY_spec)
]