pytabs.analysis_results
1# pyTABS - ETABS .NET API python wrapper 2# AnalysisResults - cAnalysisResults interface 3__all__ = ['AnalysisResults'] 4 5# import etabs namespace and error handler 6from pytabs.etabs import * 7from pytabs.error_handle import * 8 9# import typing 10from typing import TypedDict 11 12 13class PierForce(TypedDict): 14 """TypedDict class for Pier force return""" 15 number_results : int 16 story_name : list[str] 17 pier_name : list[str] 18 load_case : list[str] 19 location : list[str] 20 p : list[float] 21 v2 : list[float] 22 v3 : list[float] 23 t : list[float] 24 m2 : list[float] 25 m3 : list[float] 26 27 28 29class AnalysisResults: 30 """AnalysisResults interface""" 31 def __init__(self, sap_model : cSapModel) -> None: 32 # link of SapModel interface 33 self.sap_model = sap_model 34 # create AnalysisResultsSetup interface 35 self.analysis_results_setup = cAnalysisResultsSetup(sap_model.Results.Setup) 36 # create AnalysisResults interface 37 self.analysis_results = cAnalysisResults(sap_model.Results) 38 39 40 def deselect_all_cases_combos_for_output(self) -> None: 41 """Deselects all load cases and response combinations for output.""" 42 handle(self.analysis_results_setup.DeselectAllCasesAndCombosForOutput()) 43 44 45 def get_case_selected_for_output(self, case_name : str) -> bool: 46 """Checks if a load case is selected for output. 47 48 :param case_name: name of an existing load case 49 :type case_name: str 50 :return: `True` if the Case selected for output, `False` otherwise 51 :rtype: bool 52 """ 53 [ret, selected] = self.analysis_results_setup.GetCaseSelectedForOutput(case_name) 54 handle(ret) 55 return selected 56 57 58 def get_combo_selected_for_output(self, combo_name : str) -> bool: 59 """Checks if a load combination is selected for output. 60 61 :param combo_name: name of an existing combination 62 :type combo_name: str 63 :return: `True` if the Combination selected for output, `False` otherwise 64 :rtype: bool 65 """ 66 [ret, selected] = self.analysis_results_setup.GetComboSelectedForOutput(combo_name) 67 handle(ret) 68 return selected 69 70 71 def set_case_selected_for_output(self, case_name : str, select_state : bool = True) -> None: 72 """Sets a load case selected for output flag. 73 74 :param case_name: name of existing load case 75 :type case_name: str 76 :param select_state: select case for output, defaults to `True` 77 :type select_state: bool, optional 78 """ 79 handle(self.analysis_results_setup.SetCaseSelectedForOutput(case_name, select_state)) 80 81 82 def set_combo_selected_for_output(self, combo_name : str, select_state : bool = True) -> None: 83 """Sets a combination selected for output flag. 84 85 :param combo_name: name of the existing combination 86 :type combo_name: str 87 :param select_state: select combination for output defaults to `True` 88 :type select_state: bool, optional 89 """ 90 handle(self.analysis_results_setup.SetComboSelectedForOutput(combo_name, select_state)) 91 92 93 def pier_force(self) -> PierForce: 94 """Retrieves pier forces for any defined pier objects in the model. 95 96 :return: Pier force analysis results 97 :rtype: PierForce 98 """ 99 number_results = int() 100 story_name = [str()] 101 pier_name = [str()] 102 load_case = [str()] 103 location = [str()] 104 p = [float()] 105 v2 = [float()] 106 v3 = [float()] 107 t = [float()] 108 m2 = [float()] 109 m3 = [float()] 110 111 [ret, number_results, story_name, pier_name, 112 load_case, location, p, v2, v3, t, m2, m3] = self.analysis_results.PierForce(number_results, story_name, pier_name, 113 load_case, location, p, v2, v3, t, m2, m3) 114 # handle(ret) 115 return {'number_results': number_results, 116 'story_name': list(story_name), 117 'pier_name': list(pier_name), 118 'load_case': list(load_case), 119 'location': list(location), 120 'p': list(p), 121 'v2': list(v2), 122 'v3': list(v2), 123 't': list(t), 124 'm2': list(m2), 125 'm3': list(m3)}
class
AnalysisResults:
30class AnalysisResults: 31 """AnalysisResults interface""" 32 def __init__(self, sap_model : cSapModel) -> None: 33 # link of SapModel interface 34 self.sap_model = sap_model 35 # create AnalysisResultsSetup interface 36 self.analysis_results_setup = cAnalysisResultsSetup(sap_model.Results.Setup) 37 # create AnalysisResults interface 38 self.analysis_results = cAnalysisResults(sap_model.Results) 39 40 41 def deselect_all_cases_combos_for_output(self) -> None: 42 """Deselects all load cases and response combinations for output.""" 43 handle(self.analysis_results_setup.DeselectAllCasesAndCombosForOutput()) 44 45 46 def get_case_selected_for_output(self, case_name : str) -> bool: 47 """Checks if a load case is selected for output. 48 49 :param case_name: name of an existing load case 50 :type case_name: str 51 :return: `True` if the Case selected for output, `False` otherwise 52 :rtype: bool 53 """ 54 [ret, selected] = self.analysis_results_setup.GetCaseSelectedForOutput(case_name) 55 handle(ret) 56 return selected 57 58 59 def get_combo_selected_for_output(self, combo_name : str) -> bool: 60 """Checks if a load combination is selected for output. 61 62 :param combo_name: name of an existing combination 63 :type combo_name: str 64 :return: `True` if the Combination selected for output, `False` otherwise 65 :rtype: bool 66 """ 67 [ret, selected] = self.analysis_results_setup.GetComboSelectedForOutput(combo_name) 68 handle(ret) 69 return selected 70 71 72 def set_case_selected_for_output(self, case_name : str, select_state : bool = True) -> None: 73 """Sets a load case selected for output flag. 74 75 :param case_name: name of existing load case 76 :type case_name: str 77 :param select_state: select case for output, defaults to `True` 78 :type select_state: bool, optional 79 """ 80 handle(self.analysis_results_setup.SetCaseSelectedForOutput(case_name, select_state)) 81 82 83 def set_combo_selected_for_output(self, combo_name : str, select_state : bool = True) -> None: 84 """Sets a combination selected for output flag. 85 86 :param combo_name: name of the existing combination 87 :type combo_name: str 88 :param select_state: select combination for output defaults to `True` 89 :type select_state: bool, optional 90 """ 91 handle(self.analysis_results_setup.SetComboSelectedForOutput(combo_name, select_state)) 92 93 94 def pier_force(self) -> PierForce: 95 """Retrieves pier forces for any defined pier objects in the model. 96 97 :return: Pier force analysis results 98 :rtype: PierForce 99 """ 100 number_results = int() 101 story_name = [str()] 102 pier_name = [str()] 103 load_case = [str()] 104 location = [str()] 105 p = [float()] 106 v2 = [float()] 107 v3 = [float()] 108 t = [float()] 109 m2 = [float()] 110 m3 = [float()] 111 112 [ret, number_results, story_name, pier_name, 113 load_case, location, p, v2, v3, t, m2, m3] = self.analysis_results.PierForce(number_results, story_name, pier_name, 114 load_case, location, p, v2, v3, t, m2, m3) 115 # handle(ret) 116 return {'number_results': number_results, 117 'story_name': list(story_name), 118 'pier_name': list(pier_name), 119 'load_case': list(load_case), 120 'location': list(location), 121 'p': list(p), 122 'v2': list(v2), 123 'v3': list(v2), 124 't': list(t), 125 'm2': list(m2), 126 'm3': list(m3)}
AnalysisResults interface
AnalysisResults(sap_model: ETABSv1.cSapModel)
32 def __init__(self, sap_model : cSapModel) -> None: 33 # link of SapModel interface 34 self.sap_model = sap_model 35 # create AnalysisResultsSetup interface 36 self.analysis_results_setup = cAnalysisResultsSetup(sap_model.Results.Setup) 37 # create AnalysisResults interface 38 self.analysis_results = cAnalysisResults(sap_model.Results)
def
deselect_all_cases_combos_for_output(self) -> None:
41 def deselect_all_cases_combos_for_output(self) -> None: 42 """Deselects all load cases and response combinations for output.""" 43 handle(self.analysis_results_setup.DeselectAllCasesAndCombosForOutput())
Deselects all load cases and response combinations for output.
def
get_case_selected_for_output(self, case_name: str) -> bool:
46 def get_case_selected_for_output(self, case_name : str) -> bool: 47 """Checks if a load case is selected for output. 48 49 :param case_name: name of an existing load case 50 :type case_name: str 51 :return: `True` if the Case selected for output, `False` otherwise 52 :rtype: bool 53 """ 54 [ret, selected] = self.analysis_results_setup.GetCaseSelectedForOutput(case_name) 55 handle(ret) 56 return selected
Checks if a load case is selected for output.
Parameters
- case_name: name of an existing load case
Returns
True
if the Case selected for output,False
otherwise
def
get_combo_selected_for_output(self, combo_name: str) -> bool:
59 def get_combo_selected_for_output(self, combo_name : str) -> bool: 60 """Checks if a load combination is selected for output. 61 62 :param combo_name: name of an existing combination 63 :type combo_name: str 64 :return: `True` if the Combination selected for output, `False` otherwise 65 :rtype: bool 66 """ 67 [ret, selected] = self.analysis_results_setup.GetComboSelectedForOutput(combo_name) 68 handle(ret) 69 return selected
Checks if a load combination is selected for output.
Parameters
- combo_name: name of an existing combination
Returns
True
if the Combination selected for output,False
otherwise
def
set_case_selected_for_output(self, case_name: str, select_state: bool = True) -> None:
72 def set_case_selected_for_output(self, case_name : str, select_state : bool = True) -> None: 73 """Sets a load case selected for output flag. 74 75 :param case_name: name of existing load case 76 :type case_name: str 77 :param select_state: select case for output, defaults to `True` 78 :type select_state: bool, optional 79 """ 80 handle(self.analysis_results_setup.SetCaseSelectedForOutput(case_name, select_state))
Sets a load case selected for output flag.
Parameters
- case_name: name of existing load case
- select_state: select case for output, defaults to
True
def
set_combo_selected_for_output(self, combo_name: str, select_state: bool = True) -> None:
83 def set_combo_selected_for_output(self, combo_name : str, select_state : bool = True) -> None: 84 """Sets a combination selected for output flag. 85 86 :param combo_name: name of the existing combination 87 :type combo_name: str 88 :param select_state: select combination for output defaults to `True` 89 :type select_state: bool, optional 90 """ 91 handle(self.analysis_results_setup.SetComboSelectedForOutput(combo_name, select_state))
Sets a combination selected for output flag.
Parameters
- combo_name: name of the existing combination
- select_state: select combination for output defaults to
True
def
pier_force(self) -> pytabs.analysis_results.PierForce:
94 def pier_force(self) -> PierForce: 95 """Retrieves pier forces for any defined pier objects in the model. 96 97 :return: Pier force analysis results 98 :rtype: PierForce 99 """ 100 number_results = int() 101 story_name = [str()] 102 pier_name = [str()] 103 load_case = [str()] 104 location = [str()] 105 p = [float()] 106 v2 = [float()] 107 v3 = [float()] 108 t = [float()] 109 m2 = [float()] 110 m3 = [float()] 111 112 [ret, number_results, story_name, pier_name, 113 load_case, location, p, v2, v3, t, m2, m3] = self.analysis_results.PierForce(number_results, story_name, pier_name, 114 load_case, location, p, v2, v3, t, m2, m3) 115 # handle(ret) 116 return {'number_results': number_results, 117 'story_name': list(story_name), 118 'pier_name': list(pier_name), 119 'load_case': list(load_case), 120 'location': list(location), 121 'p': list(p), 122 'v2': list(v2), 123 'v3': list(v2), 124 't': list(t), 125 'm2': list(m2), 126 'm3': list(m3)}
Retrieves pier forces for any defined pier objects in the model.
Returns
Pier force analysis results