pytabs.pier_label

  1# pyTABS - ETABS .NET API python wrapper
  2# PierLabel - cPierLabel interface 
  3__all__ = ['PierLabel']
  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 SectionProperties(TypedDict):
 14    """TypedDict class for Pier section properties return"""
 15    pier_name : str
 16    number_stories : int
 17    story_name : list[str]
 18    axis_angle : list[float]
 19    num_area_objs : list[int]
 20    num_line_objs : list[int]
 21    width_bot : list[float]
 22    thickness_bot : list[float]
 23    width_top : list[float]
 24    thickness_top : list[float]
 25    mat_prop : list[str]
 26    cg_bot_x : list[float]
 27    cg_bot_y : list[float]
 28    cg_bot_z : list[float]
 29    cg_top_x : list[float]
 30    cg_top_y : list[float]
 31    cg_top_z : list[float]
 32
 33
 34class PierLabel:
 35    """PierLabel interface"""
 36    def __init__(self, sap_model : cSapModel) -> None:
 37        # link of SapModel interface
 38        self.sap_model = sap_model
 39        # create PierLabel interface
 40        self.pier_label = cPierLabel(self.sap_model.PierLabel)
 41
 42
 43    def change_name(self, pier_name : str, new_pier_name : str) -> None:
 44        """Changes the name of a defined Pier Label.
 45
 46        :param pier_name: name of defined pier to change
 47        :type pier_name: str
 48        :param new_pier_name: new name of pier
 49        :type new_pier_name: str
 50        """
 51        handle(self.pier_label.ChangeName(pier_name, new_pier_name))
 52
 53
 54    def delete(self, pier_name : str) -> None:
 55        """Deletes the specified Pier Label.
 56
 57        :param pier_name: name of defined pier to delete
 58        :type pier_name: str
 59        """
 60        handle(self.pier_label.Delete(pier_name))
 61
 62
 63    def get_names_list(self) -> list[str]:
 64        """Retrieves the names of all defined Pier Labels.
 65
 66        :return: All Pier Labels
 67        :rtype: list[str]
 68        """
 69        number_names = int()
 70        pier_names = [str()]
 71        [ret, number_names, pier_names] = self.pier_label.GetNameList(number_names, pier_names)
 72        handle(ret)
 73        return list(pier_names)
 74    
 75    
 76    def get_pier(self, pier_name : str) -> bool:
 77        """Checks whether the specified Pier Label exists.
 78
 79        :param pier_name: pier name to check
 80        :type pier_name: str
 81        :return: True if the Pier Label exists, False otherwise
 82        :rtype: bool
 83        """
 84        ret = self.pier_label.GetPier(pier_name)
 85        if ret == 0:
 86            return True
 87        return False
 88    
 89    
 90    def get_section_properties(self, pier_name : str) -> SectionProperties:
 91        """Retrieves the section properties for a specified pier.
 92
 93        :param pier_name: Pier name for which to retrieve section properties
 94        :type pier_name: str
 95        :return: section properties of requested Pier
 96        :rtype: SectionProperties
 97        """
 98        number_stories = int()
 99        story_name = [str()]
100        axis_angle = [float()]
101        num_area_objs = [int()]
102        num_line_objs = [int()]
103        width_bot = [float()]
104        thickness_bot = [float()]
105        width_top = [float()]
106        thickness_top = [float()]
107        mat_prop = [str()]
108        cg_bot_x = [float()]
109        cg_bot_y = [float()]
110        cg_bot_z = [float()]
111        cg_top_x = [float()]
112        cg_top_y = [float()]
113        cg_top_z = [float()]
114        [ret, number_stories, story_name, axis_angle,
115         num_area_objs, num_line_objs, width_bot,
116         thickness_bot, width_top, thickness_top,
117         mat_prop, cg_bot_x, cg_bot_y, cg_bot_z,
118         cg_top_x, cg_top_y, cg_top_z] = self.pier_label.GetSectionProperties(pier_name, number_stories, story_name,
119                                                                              axis_angle, num_area_objs, num_line_objs,
120                                                                              width_bot, thickness_bot, width_top,
121                                                                              thickness_top, mat_prop, cg_bot_x, cg_bot_y,
122                                                                              cg_bot_z, cg_top_x, cg_top_y, cg_top_z)
123        # handle(ret) - if pier exists but no elements assigned ret != 0
124        return {'pier_name': pier_name,
125                'number_stories': number_stories,
126                'story_name': list(story_name),
127                'axis_angle': list(axis_angle),
128                'num_area_objs': list(num_area_objs),
129                'num_line_objs': list(num_line_objs),
130                'width_bot': list(width_bot),
131                'thickness_bot': list(thickness_bot),
132                'width_top': list(width_top),
133                'thickness_top': list(thickness_top),
134                'mat_prop': list(mat_prop),
135                'cg_bot_x': list(cg_bot_x),
136                'cg_bot_y': list(cg_bot_y),
137                'cg_bot_z': list(cg_bot_z),
138                'cg_top_x': list(cg_top_x),
139                'cg_top_y': list(cg_top_y),
140                'cg_top_z': list(cg_top_z)}
141    
142    
143    def set_pier(self, pier_name : str) -> None:
144        """Adds a new Pier Label. 
145
146        :param pier_name: name of new pier label
147        :type pier_name: str
148        """
149        handle(self.pier_label.SetPier(pier_name))
class PierLabel:
 35class PierLabel:
 36    """PierLabel interface"""
 37    def __init__(self, sap_model : cSapModel) -> None:
 38        # link of SapModel interface
 39        self.sap_model = sap_model
 40        # create PierLabel interface
 41        self.pier_label = cPierLabel(self.sap_model.PierLabel)
 42
 43
 44    def change_name(self, pier_name : str, new_pier_name : str) -> None:
 45        """Changes the name of a defined Pier Label.
 46
 47        :param pier_name: name of defined pier to change
 48        :type pier_name: str
 49        :param new_pier_name: new name of pier
 50        :type new_pier_name: str
 51        """
 52        handle(self.pier_label.ChangeName(pier_name, new_pier_name))
 53
 54
 55    def delete(self, pier_name : str) -> None:
 56        """Deletes the specified Pier Label.
 57
 58        :param pier_name: name of defined pier to delete
 59        :type pier_name: str
 60        """
 61        handle(self.pier_label.Delete(pier_name))
 62
 63
 64    def get_names_list(self) -> list[str]:
 65        """Retrieves the names of all defined Pier Labels.
 66
 67        :return: All Pier Labels
 68        :rtype: list[str]
 69        """
 70        number_names = int()
 71        pier_names = [str()]
 72        [ret, number_names, pier_names] = self.pier_label.GetNameList(number_names, pier_names)
 73        handle(ret)
 74        return list(pier_names)
 75    
 76    
 77    def get_pier(self, pier_name : str) -> bool:
 78        """Checks whether the specified Pier Label exists.
 79
 80        :param pier_name: pier name to check
 81        :type pier_name: str
 82        :return: True if the Pier Label exists, False otherwise
 83        :rtype: bool
 84        """
 85        ret = self.pier_label.GetPier(pier_name)
 86        if ret == 0:
 87            return True
 88        return False
 89    
 90    
 91    def get_section_properties(self, pier_name : str) -> SectionProperties:
 92        """Retrieves the section properties for a specified pier.
 93
 94        :param pier_name: Pier name for which to retrieve section properties
 95        :type pier_name: str
 96        :return: section properties of requested Pier
 97        :rtype: SectionProperties
 98        """
 99        number_stories = int()
100        story_name = [str()]
101        axis_angle = [float()]
102        num_area_objs = [int()]
103        num_line_objs = [int()]
104        width_bot = [float()]
105        thickness_bot = [float()]
106        width_top = [float()]
107        thickness_top = [float()]
108        mat_prop = [str()]
109        cg_bot_x = [float()]
110        cg_bot_y = [float()]
111        cg_bot_z = [float()]
112        cg_top_x = [float()]
113        cg_top_y = [float()]
114        cg_top_z = [float()]
115        [ret, number_stories, story_name, axis_angle,
116         num_area_objs, num_line_objs, width_bot,
117         thickness_bot, width_top, thickness_top,
118         mat_prop, cg_bot_x, cg_bot_y, cg_bot_z,
119         cg_top_x, cg_top_y, cg_top_z] = self.pier_label.GetSectionProperties(pier_name, number_stories, story_name,
120                                                                              axis_angle, num_area_objs, num_line_objs,
121                                                                              width_bot, thickness_bot, width_top,
122                                                                              thickness_top, mat_prop, cg_bot_x, cg_bot_y,
123                                                                              cg_bot_z, cg_top_x, cg_top_y, cg_top_z)
124        # handle(ret) - if pier exists but no elements assigned ret != 0
125        return {'pier_name': pier_name,
126                'number_stories': number_stories,
127                'story_name': list(story_name),
128                'axis_angle': list(axis_angle),
129                'num_area_objs': list(num_area_objs),
130                'num_line_objs': list(num_line_objs),
131                'width_bot': list(width_bot),
132                'thickness_bot': list(thickness_bot),
133                'width_top': list(width_top),
134                'thickness_top': list(thickness_top),
135                'mat_prop': list(mat_prop),
136                'cg_bot_x': list(cg_bot_x),
137                'cg_bot_y': list(cg_bot_y),
138                'cg_bot_z': list(cg_bot_z),
139                'cg_top_x': list(cg_top_x),
140                'cg_top_y': list(cg_top_y),
141                'cg_top_z': list(cg_top_z)}
142    
143    
144    def set_pier(self, pier_name : str) -> None:
145        """Adds a new Pier Label. 
146
147        :param pier_name: name of new pier label
148        :type pier_name: str
149        """
150        handle(self.pier_label.SetPier(pier_name))

PierLabel interface

PierLabel(sap_model: ETABSv1.cSapModel)
37    def __init__(self, sap_model : cSapModel) -> None:
38        # link of SapModel interface
39        self.sap_model = sap_model
40        # create PierLabel interface
41        self.pier_label = cPierLabel(self.sap_model.PierLabel)
def change_name(self, pier_name: str, new_pier_name: str) -> None:
44    def change_name(self, pier_name : str, new_pier_name : str) -> None:
45        """Changes the name of a defined Pier Label.
46
47        :param pier_name: name of defined pier to change
48        :type pier_name: str
49        :param new_pier_name: new name of pier
50        :type new_pier_name: str
51        """
52        handle(self.pier_label.ChangeName(pier_name, new_pier_name))

Changes the name of a defined Pier Label.

Parameters
  • pier_name: name of defined pier to change
  • new_pier_name: new name of pier
def delete(self, pier_name: str) -> None:
55    def delete(self, pier_name : str) -> None:
56        """Deletes the specified Pier Label.
57
58        :param pier_name: name of defined pier to delete
59        :type pier_name: str
60        """
61        handle(self.pier_label.Delete(pier_name))

Deletes the specified Pier Label.

Parameters
  • pier_name: name of defined pier to delete
def get_names_list(self) -> list[str]:
64    def get_names_list(self) -> list[str]:
65        """Retrieves the names of all defined Pier Labels.
66
67        :return: All Pier Labels
68        :rtype: list[str]
69        """
70        number_names = int()
71        pier_names = [str()]
72        [ret, number_names, pier_names] = self.pier_label.GetNameList(number_names, pier_names)
73        handle(ret)
74        return list(pier_names)

Retrieves the names of all defined Pier Labels.

Returns

All Pier Labels

def get_pier(self, pier_name: str) -> bool:
77    def get_pier(self, pier_name : str) -> bool:
78        """Checks whether the specified Pier Label exists.
79
80        :param pier_name: pier name to check
81        :type pier_name: str
82        :return: True if the Pier Label exists, False otherwise
83        :rtype: bool
84        """
85        ret = self.pier_label.GetPier(pier_name)
86        if ret == 0:
87            return True
88        return False

Checks whether the specified Pier Label exists.

Parameters
  • pier_name: pier name to check
Returns

True if the Pier Label exists, False otherwise

def get_section_properties(self, pier_name: str) -> pytabs.pier_label.SectionProperties:
 91    def get_section_properties(self, pier_name : str) -> SectionProperties:
 92        """Retrieves the section properties for a specified pier.
 93
 94        :param pier_name: Pier name for which to retrieve section properties
 95        :type pier_name: str
 96        :return: section properties of requested Pier
 97        :rtype: SectionProperties
 98        """
 99        number_stories = int()
100        story_name = [str()]
101        axis_angle = [float()]
102        num_area_objs = [int()]
103        num_line_objs = [int()]
104        width_bot = [float()]
105        thickness_bot = [float()]
106        width_top = [float()]
107        thickness_top = [float()]
108        mat_prop = [str()]
109        cg_bot_x = [float()]
110        cg_bot_y = [float()]
111        cg_bot_z = [float()]
112        cg_top_x = [float()]
113        cg_top_y = [float()]
114        cg_top_z = [float()]
115        [ret, number_stories, story_name, axis_angle,
116         num_area_objs, num_line_objs, width_bot,
117         thickness_bot, width_top, thickness_top,
118         mat_prop, cg_bot_x, cg_bot_y, cg_bot_z,
119         cg_top_x, cg_top_y, cg_top_z] = self.pier_label.GetSectionProperties(pier_name, number_stories, story_name,
120                                                                              axis_angle, num_area_objs, num_line_objs,
121                                                                              width_bot, thickness_bot, width_top,
122                                                                              thickness_top, mat_prop, cg_bot_x, cg_bot_y,
123                                                                              cg_bot_z, cg_top_x, cg_top_y, cg_top_z)
124        # handle(ret) - if pier exists but no elements assigned ret != 0
125        return {'pier_name': pier_name,
126                'number_stories': number_stories,
127                'story_name': list(story_name),
128                'axis_angle': list(axis_angle),
129                'num_area_objs': list(num_area_objs),
130                'num_line_objs': list(num_line_objs),
131                'width_bot': list(width_bot),
132                'thickness_bot': list(thickness_bot),
133                'width_top': list(width_top),
134                'thickness_top': list(thickness_top),
135                'mat_prop': list(mat_prop),
136                'cg_bot_x': list(cg_bot_x),
137                'cg_bot_y': list(cg_bot_y),
138                'cg_bot_z': list(cg_bot_z),
139                'cg_top_x': list(cg_top_x),
140                'cg_top_y': list(cg_top_y),
141                'cg_top_z': list(cg_top_z)}

Retrieves the section properties for a specified pier.

Parameters
  • pier_name: Pier name for which to retrieve section properties
Returns

section properties of requested Pier

def set_pier(self, pier_name: str) -> None:
144    def set_pier(self, pier_name : str) -> None:
145        """Adds a new Pier Label. 
146
147        :param pier_name: name of new pier label
148        :type pier_name: str
149        """
150        handle(self.pier_label.SetPier(pier_name))

Adds a new Pier Label.

Parameters
  • pier_name: name of new pier label