Exemple #1
0
    def shape_waist_steel(self,
                          bar_diameter,
                          point_f,
                          point_t,
                          extend=0,
                          mirror=False):

        point_list = []

        if mirror:
            point_list.append((AllplanGeo.Point3D(point_f - extend, 0, 0), 0))
            point_list.append((AllplanGeo.Point3D(point_t, 0, 0), 0))
        else:
            point_list.append((AllplanGeo.Point3D(point_f, 0, 0), 0))
            point_list.append((AllplanGeo.Point3D(point_t + extend, 0, 0), 0))

        shape_type = AllplanReinf.BendingShapeType.Freeform
        shape_build = AllplanReinf.ReinforcementShapeBuilder()
        shape_build.AddPoints(point_list)
        rebar_prop = {
            'diameter': bar_diameter,
            'bending_roller': 0,
            'steel_grade': self.WaistBarGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': shape_type
        }
        shape_props = ReinforcementShapeProperties.rebar(**rebar_prop)
        shape = shape_build.CreateShape(shape_props)
        if shape.IsValid():
            return shape
Exemple #2
0
    def shape_bar(self, build_ele, bar_diameter, extend_length=0):
        '''
        纵筋建模函数
        
        Args:
            build_ele: build_ele.get_parameter_dict()
            build_ele: .pyp文件内的 Name标签的参数字典
        '''
        bending_roller = 0
        steel_grade = build_ele['BarSteelGrade']
        concrete_grade = build_ele['BarConcreteGrade']
        bending_shape_type = AllplanReinf.BendingShapeType.Freeform
        concrete_cover = 0

        concrete_props = ConcreteCoverProperties(top=0,
                                                 right=0,
                                                 left=0,
                                                 bottom=concrete_cover)

        shape_props = ReinforcementShapeProperties.rebar(
            bar_diameter, bending_roller, steel_grade, concrete_grade,
            bending_shape_type)

        shape_builder = AllplanReinf.ReinforcementShapeBuilder()

        shape_builder.AddPoints([
            (AllplanGeo.Point3D(0 - extend_length, 0, 0), 0),
            (AllplanGeo.Point3D(self.length + extend_length, 0, 0), 0)
        ])

        shape = shape_builder.CreateShape(shape_props)

        return shape
Exemple #3
0
    def create_long_steel(self):
        steel_list = []
        if self.AnchorBend:
            fst_shape = self.shape_longitudinal_steel(self.FirstDia,
                                                      self.Length,
                                                      self.AnchorBendLength,
                                                      self.AnchorBend)
        else:
            fst_shape = self.shape_longitudinal_steel(self.FirstDia,
                                                      self.Length,
                                                      self.AnchorLength)
        cover = self.ConcreteCover + self.FirstDia / 2 + self.StirDiameter
        fst_point_f = AllplanGeo.Point3D(0, 0, cover)
        fst_point_t = AllplanGeo.Point3D(0, self.Width, cover)
        steel_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                0, fst_shape, fst_point_f, fst_point_t, cover, cover,
                self.FirstNum))

        other_shape = self.shape_longitudinal_steel(
            self.OtherDia, self.Length, -self.SlotLength - self.OtherHeadCover)

        distance = 0
        for num in range(self.LongBarLines - 1):
            distance += self.BarDistance
            oth_point_f = AllplanGeo.Point3D(0, 0, cover + distance)
            oth_point_t = AllplanGeo.Point3D(0, self.Width, cover + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                    0, other_shape, oth_point_f, oth_point_t, cover, cover,
                    self.FirstNum))
        return steel_list
Exemple #4
0
    def create_geometry(self, build_ele):
        '''
        Create the element geometries
        构建元素几何图形函数

        Args:
            build_ele: the building element
            .pyp文件输入参数,build_ele代表整个.pyp文件信息
        '''

        length = build_ele['Length']  #长
        width = build_ele['Width']  #宽
        thick = build_ele['Thick']  #厚

        #point
        from_point = AllplanGeo.Point3D(0, 0, 0)
        to_point = AllplanGeo.Point3D(length, width, thick)

        rectangle = AllplanGeo.Polyhedron3D.CreateCuboid(from_point,
                                                         to_point)  #矩形

        return [
            AllplanBasisElements.ModelElement3D(self.com_prop, self.surf,
                                                rectangle)
        ]
Exemple #5
0
    def create_waist_steel(self):
        steel_list = []
        waist_length = (self.Length - self.CutLength -
                        2 * self.WaistHeadCover) / 2
        waist_shape = self.shape_waist_steel(self.WaistBarDia,
                                             self.WaistHeadCover,
                                             self.CutPosition,
                                             self.CutBarExtend)
        m_waist_shape = self.shape_waist_steel(
            self.WaistBarDia, self.CutPosition + self.CutLength,
            self.Length - self.WaistHeadCover, self.CutBarExtend, True)
        cover = self.ConcreteCover + self.StirDiameter

        distance = 0
        for x in range(self.WaistNum):
            point_f = AllplanGeo.Point3D(0, 0, self.WaistPosition + distance)
            point_t = AllplanGeo.Point3D(0, self.Width,
                                         self.WaistPosition + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                    0, waist_shape, point_f, point_t, cover, cover, 2))

            m_point_f = AllplanGeo.Point3D(0, 0, self.WaistPosition + distance)
            m_point_t = AllplanGeo.Point3D(0, self.Width,
                                           self.WaistPosition + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                    0, m_waist_shape, m_point_f, m_point_t, cover, cover, 2))
            distance += self.WaistDistance

        return steel_list
    def __init__(self, coord_input, pyp_path, str_table_service):
        """
        Initialization of class Line3DInteractor

        Args:
            coord_input:        coordinate input
            pyp_path:           path of the pyp file
            str_table_service:  string table service
        """

        self.coord_input = coord_input
        self.pyp_path = pyp_path
        self.str_table_service = str_table_service
        self.first_point_input = True
        self.first_point = AllplanGeo.Point3D()
        self.model_ele_list = None
        self.build_ele_service = BuildingElementService()

        ####
        self.current_point = AllplanGeo.Point3D()
        self.valid_input = False
        self.b_use_input_pnt = True
        self.polyline_lenght = 0.0
        self.frist_run_transf = True
        self.cont_polyline = AllplanGeo.Polyline3D()

        #----------------- read the data and show the palette
        print(pyp_path + "\\DryWall_3.pal")

        result, self.build_ele_script, self.build_ele_list, self.control_props_list, \
                self.build_ele_composite, part_name, self.file_name = \
                self.build_ele_service.read_data_from_pyp(pyp_path + "\\DryWall_3.pal", self.str_table_service.str_table, False,
                                                      self.str_table_service.material_str_table)

        if not result:
            return

        self.palette_service = BuildingElementPaletteService(
            self.build_ele_list, self.build_ele_composite,
            self.build_ele_script, self.control_props_list, self.file_name)

        self.palette_service.show_palette(part_name)

        self.points = []

        #----------------- get the properties and start the input

        self.com_prop = AllplanBaseElements.CommonProperties()

        self.set_common_properties()

        self.coord_input.InitFirstPointInput(
            AllplanIFW.InputStringConvert("From point"))
    def __transform_base_polygon__(self, path, polyline3D_contur):
        """
        Transforms the base polygon3D

        Args:
            path:               only the first segment is needed
            polyline3D_contur:  will be transformed to placed perpendicular on the first segment of the path

        Returns:
            transformed polyline3D_contur

        """

        pnt1 = path.GetPoint(0)
        pnt2 = path.GetPoint(1)

        diff_x = pnt2.X - pnt1.X
        diff_y = pnt2.Y - pnt1.Y
        diff_z = pnt2.Z - pnt1.Z

        tmp_plane = AllplanGeo.Plane3D(
            AllplanGeo.Point3D(0, 0, 0),
            AllplanGeo.Vector3D(diff_x, diff_y, diff_z))

        matrix = AllplanGeo.Matrix3D()
        matrix = tmp_plane.GetTransformationMatrix()
        result = AllplanGeo.Transform(polyline3D_contur, matrix)
        matrix2 = AllplanGeo.Matrix3D()
        matrix2.SetTranslation(AllplanGeo.Vector3D(pnt1.X, pnt1.Y, pnt1.Z))
        result = AllplanGeo.Transform(result, matrix2)
        return result
Exemple #8
0
    def create_longitudinal_steel(self):
        steel_list = []

        rebar_prop = {
            'diameter': self.VertSteelDia,
            'bending_roller': math.pi * 3 * self.VertSteelDia / 40,
            'steel_grade': self.VertSteelGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': AllplanReinf.BendingShapeType.LongitudinalBar
        }

        cover = ConcreteCoverProperties(0, 0, 0, self.VertBottomCover)

        longitudinal = LongitudinalSteel(cover, rebar_prop)

        steel_shape = longitudinal.shape_extend_steel(
            length=self.Height,
            extend=self.VertExtendLength,
            extend_side=2,
            vertical=True)

        point_f_1 = AllplanGeo.Point3D(
            0, self.StirFrontCover + self.StirDiameter + self.VertSteelDia, 0)
        point_t_1 = AllplanGeo.Point3D(
            self.Length,
            self.StirFrontCover + self.StirDiameter + self.VertSteelDia, 0)
        steel_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, steel_shape, point_f_1, point_t_1,
                self.StirSideCover + self.StirDiameter + self.VertSteelDia,
                self.StirSideCover + self.StirDiameter + self.VertSteelDia,
                self.VertDistance, 4))

        point_f_2 = AllplanGeo.Point3D(
            0, self.Width -
            (self.StirFrontCover + self.StirDiameter + self.VertSteelDia), 0)
        point_t_2 = AllplanGeo.Point3D(
            self.Length, self.Width -
            (self.StirFrontCover + self.StirDiameter + self.VertSteelDia), 0)
        steel_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, steel_shape, point_f_2, point_t_2,
                self.StirSideCover + self.StirDiameter + self.VertSteelDia,
                self.StirSideCover + self.StirDiameter + self.VertSteelDia,
                self.VertDistance, 4))

        return steel_list
    def add_door(self, build_ele, com_prop_stroke, wall_length, wall_width,
                 wall_thickness):
        d_x = build_ele.door_x.value
        d_y = 0
        d_z = 0

        door_length = build_ele.door_length.value
        door_width = build_ele.door_width.value
        door_thickness = wall_thickness

        door = AllplanGeo.Polyhedron3D.CreateCuboid(door_length,
                                                    door_thickness, door_width)
        trans_to_ref_point_3 = AllplanGeo.Matrix3D()
        trans_to_ref_point_3.Translate(AllplanGeo.Vector3D(d_x, d_y, d_z))
        door = AllplanGeo.Transform(door, trans_to_ref_point_3)

        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_stroke, door))

        #--------------------------------------------------------------------------------------#
        #----------------------------------Door Handle-----------------------------------------#
        #--------------------------------------------------------------------------------------#

        origin = AllplanGeo.Point3D(0, 0, 0)
        door_plength = AllplanGeo.Point3D(d_x + door_length, 0, 0)
        door_pwidth = AllplanGeo.Point3D(d_x, 0, door_width)
        door_pointx = AllplanGeo.Point3D(d_x, 0, 0)

        handle_doorlength = HandleProperties(
            "DoorMoveLength", door_plength, door_pointx,
            [("door_length", HandleDirection.x_dir)], HandleDirection.x_dir,
            True)
        self.handle_list.append(handle_doorlength)

        handle_doorwidth = HandleProperties(
            "DoorMoveWidth", door_pwidth, door_pointx,
            [("door_width", HandleDirection.z_dir)], HandleDirection.z_dir,
            True)
        self.handle_list.append(handle_doorwidth)
        handle_doorx = HandleProperties("doorMoveX", door_pointx, origin,
                                        [("door_x", HandleDirection.x_dir)],
                                        HandleDirection.x_dir, False)
        self.handle_list.append(handle_doorx)

        return door
Exemple #10
0
    def shape_stiff(self,
                    stiff_length,
                    stiff_width,
                    stiff_height,
                    rX=0,
                    rY=0,
                    rZ=0,
                    sX=0,
                    sY=0,
                    sZ=0):
        '''
        shape_stiff
        筋板构形

        Args:
            stiff_length:
            stiff_width:
            stiff_height:
            rX:
            rY:
            rZ:
            sX:
            sY:
            sZ:

        Return:
            A stiff object
            筋板对象
        '''

        args = {
            'refPoint': AllplanGeo.Point3D(rX, rY, rZ),
            'startPoint': AllplanGeo.Point3D(sX, sY, sZ),
            'vec1': AllplanGeo.Vector3D(stiff_length, 0, 0),
            'vec2': AllplanGeo.Vector3D(0, stiff_width, 0),
            'vec3': AllplanGeo.Vector3D(0, 0, stiff_height)
        }

        gen_stiff = AllplanGeo.Cuboid3D(**args)

        return gen_stiff
Exemple #11
0
    def create_geometry(self):
        '''
        Create the element geometries
        构建元素几何图形函数

        Args:
            build_ele: the building element
            .pyp文件输入参数,build_ele代表整个.pyp文件信息
        '''

        #point
        from_point = AllplanGeo.Point3D(0, 0, 0)
        to_point = AllplanGeo.Point3D(self.Length, self.Width, self.Height)

        rectangle = AllplanGeo.Polyhedron3D.CreateCuboid(from_point,
                                                         to_point)  #矩形

        return [
            AllplanBasisElements.ModelElement3D(self.com_prop, self.texturedef,
                                                rectangle)
        ]
Exemple #12
0
    def create_handle(self, build_ele):
        '''
        Create handle
        创建可拉动游标句柄

        Args:
            build_ele: the building element dict
            .pyp文件的变量参数字典
        Return:
            
        '''
        length = build_ele['Length']  #长
        width = build_ele['Width']  #宽
        thick = build_ele['Thick']  #厚

        self.handle_list.append(
            HandleProperties("Thick", AllplanGeo.Point3D(0, 0, thick),
                             AllplanGeo.Point3D(0, 0, 0),
                             [("Thick", HandleDirection.z_dir)],
                             HandleDirection.z_dir, True))

        self.handle_list.append(
            HandleProperties("Width", AllplanGeo.Point3D(0, width, 0),
                             AllplanGeo.Point3D(0, 0, 0),
                             [("Width", HandleDirection.y_dir)],
                             HandleDirection.y_dir, True))

        self.handle_list.append(
            HandleProperties("Length", AllplanGeo.Point3D(length, 0, 0),
                             AllplanGeo.Point3D(0, 0, 0),
                             [("Length", HandleDirection.x_dir)],
                             HandleDirection.x_dir, True))
Exemple #13
0
    def create_geometry(self, build_ele):
        '''
        Create the element geometries
        构建元素几何图形函数

        Args:
            build_ele: build_ele.get_parameter_dict()
            build_ele: .pyp文件内的 Name标签的参数字典
        '''

        self.length = build_ele['Length']  #长
        self.width = build_ele['Width']  #宽
        self.height = build_ele['Height']  #高

        #point
        from_point = AllplanGeo.Point3D(0, 0, 0)
        to_point = AllplanGeo.Point3D(self.length, self.width, self.height)

        rectangle = AllplanGeo.Polyhedron3D.CreateCuboid(from_point,
                                                         to_point)  #矩形

        return rectangle
    def shape_steel(self, length, vertical=False):
        self._shape_props.prop_bending_shape_type = AllplanReinf.BendingShapeType.LongitudinalBar
        point_list = []
        if vertical:
            point_list.append((AllplanGeo.Point3D(self._cover.bottom, 0,
                                                  0), 0))
            point_list.append((AllplanGeo.Point3D(length - self._cover.top, 0,
                                                  0), 0))
        else:
            point_list.append((AllplanGeo.Point3D(self._cover.left, 0, 0), 0))
            point_list.append((AllplanGeo.Point3D(length - self._cover.right,
                                                  0, 0), 0))

        shape_build = AllplanReinf.ReinforcementShapeBuilder()
        shape_build.AddPoints(point_list)

        shape = shape_build.CreateShape(self._shape_props)
        if vertical:
            angle = RotationAngles(0, -90, 0)
            shape.Rotate(angle)
        if shape.IsValid():
            return shape
def create_element(build_ele, doc):
    """
    Creation of element (only necessary for the library preview)

    Args:
        build_ele: the building element.
        doc:       input document
    """

    del build_ele
    del doc

    com_prop = AllplanBaseElements.CommonProperties()

    com_prop.GetGlobalProperties()

    poly = AllplanGeo.Polyline3D()
    poly += AllplanGeo.Point3D(0, 0, 0)
    poly += AllplanGeo.Point3D(0, 0, 1000)
    poly += AllplanGeo.Point3D(500, 0, 1000)
    poly += AllplanGeo.Point3D(500, 500, 2000)

    model_ele_list = [AllplanBasisElements.ModelElement3D(com_prop, poly)]
    return (model_ele_list, None, None)
    def create_element(self):
        """
        Create the element

        Args:
            point_list:  Point list
        """
        dmmy_pnt = AllplanGeo.Point3D()
        self.b_use_input_pnt = False
        self.__create_model_element__(dmmy_pnt)
        AllplanBaseElements.CreateElements(
            self.coord_input.GetInputViewDocument(), AllplanGeo.Matrix3D(),
            self.model_ele_list, [], None)

        self.polyline_lenght = 0.0  #reset value
Exemple #17
0
    def add_windows(self, build_ele, com_prop_stroke, wall_length, wall_width,
                    wall_thickness):
        p_x = build_ele.win_x.value
        p_y = 0
        p_z = build_ele.win_z.value

        void_length = build_ele.win_length.value
        void_width = build_ele.win_width.value
        void_thickness = wall_thickness

        void = AllplanGeo.Polyhedron3D.CreateCuboid(void_length,
                                                    void_thickness, void_width)
        trans_to_ref_point_2 = AllplanGeo.Matrix3D()
        trans_to_ref_point_2.Translate(AllplanGeo.Vector3D(p_x, p_y, p_z))
        void = AllplanGeo.Transform(void, trans_to_ref_point_2)

        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_stroke, void))

        #--------------------------------------------------------------------------------------#
        #----------------------------------Void Handle-----------------------------------------#
        #--------------------------------------------------------------------------------------#
        origin = AllplanGeo.Point3D(0, 0, 0)

        originwin = AllplanGeo.Point3D(p_x, 0, p_z)
        win_plength = AllplanGeo.Point3D(p_x + void_length, 0, p_z)
        win_pwidth = AllplanGeo.Point3D(p_x, 0, p_z + void_width)
        win_pointx = AllplanGeo.Point3D(p_x + void_length / 2, 0, p_z)
        win_pointz = AllplanGeo.Point3D(p_x, 0, p_z + void_width / 2)

        handle_winlength = HandleProperties(
            "windowsMoveLength", win_plength, originwin,
            [("win_length", HandleDirection.x_dir)], HandleDirection.x_dir,
            True)
        self.handle_list.append(handle_winlength)

        handle_winwidth = HandleProperties(
            "windowsMoveWidth", win_pwidth, originwin,
            [("win_width", HandleDirection.z_dir)], HandleDirection.z_dir,
            True)
        self.handle_list.append(handle_winwidth)

        handle_winx = HandleProperties("windowsMoveX", win_pointx, originwin,
                                       [("win_x", HandleDirection.x_dir)],
                                       HandleDirection.x_dir, False)
        self.handle_list.append(handle_winx)

        handle_winz = HandleProperties("windowsMoveZ", win_pointz, origin,
                                       [("win_z", HandleDirection.z_dir)],
                                       HandleDirection.z_dir, False)
        self.handle_list.append(handle_winz)

        return void
Exemple #18
0
    def shape_cuboid(self,
                     length,
                     width,
                     height,
                     sX=0,
                     sY=0,
                     sZ=0,
                     rX=0,
                     rY=0,
                     rZ=0):

        axis = AllplanGeo.AxisPlacement3D(
            AllplanGeo.Point3D(rX + sX, rY + sY, rZ + sZ),
            AllplanGeo.Vector3D(1, 0, 0), AllplanGeo.Vector3D(0, 0, 1))

        args = {
            'placement': axis,
            'length': length,
            'width': width,
            'height': height
        }

        shape = AllplanGeo.BRep3D.CreateCuboid(**args)
        return shape
Exemple #19
0
    def create_handle(self):
        '''
        Create handle
        创建可拉动游标句柄

        '''
        self.handle_list.append(
            HandleProperties("Height", AllplanGeo.Point3D(0, 0, self.height),
                             AllplanGeo.Point3D(0, 0, 0),
                             [("Height", HandleDirection.z_dir)],
                             HandleDirection.z_dir, True))

        self.handle_list.append(
            HandleProperties("Width", AllplanGeo.Point3D(0, self.width, 0),
                             AllplanGeo.Point3D(0, 0, 0),
                             [("Width", HandleDirection.y_dir)],
                             HandleDirection.y_dir, True))

        self.handle_list.append(
            HandleProperties("Length", AllplanGeo.Point3D(self.length, 0, 0),
                             AllplanGeo.Point3D(0, 0, 0),
                             [("Length", HandleDirection.x_dir)],
                             HandleDirection.x_dir, True))
Exemple #20
0
    def add_joins_right(self, build_ele, com_prop_stroke, type=1):
        wall_length = build_ele.Length1_1.value
        wall_width = build_ele.Width1_1.value
        wall_thickness = build_ele.Thickness1_1.value

        j_a = build_ele.type2_a.value
        j_c = build_ele.type2_c.value
        j_d = build_ele.type2_d.value

        join2_point = AllplanGeo.Polygon2D()

        path2 = AllplanGeo.Polyline3D()

        ref_pnt = AllplanGeo.Point2D(0, 0)

        if (type == 1):
            j_b = wall_thickness / 2

            join2_point += AllplanGeo.Point2D(0, -j_a / 2)
            join2_point += AllplanGeo.Point2D(-j_c, -j_d / 2)
            join2_point += AllplanGeo.Point2D(-j_c, j_d / 2)
            join2_point += AllplanGeo.Point2D(0, j_a / 2)
            join2_point += AllplanGeo.Point2D(0, -j_a / 2)

            if not GeometryValidate.is_valid(join2_point):
                return

            path2 += AllplanGeo.Point3D(wall_length, j_b, 0)
            path2 += AllplanGeo.Point3D(wall_length, j_b, wall_width)

        if (type == 2):
            j_b = build_ele.type2_b.value
            join2_point += AllplanGeo.Point2D(-j_a / 2, 0)
            join2_point += AllplanGeo.Point2D(-j_d / 2, j_c)
            join2_point += AllplanGeo.Point2D(j_d / 2, j_c)
            join2_point += AllplanGeo.Point2D(j_a / 2, 0)
            join2_point += AllplanGeo.Point2D(-j_a / 2, 0)

            if not GeometryValidate.is_valid(join2_point):
                return

            path2 += AllplanGeo.Point3D(wall_length - j_b, 0, 0)
            path2 += AllplanGeo.Point3D(wall_length - j_b, 0, wall_width)

            handle_b2 = HandleProperties(
                "Moveb2", AllplanGeo.Point3D(wall_length - j_b, 0, 0),
                AllplanGeo.Point3D(wall_length, 0,
                                   0), [("type2_b", HandleDirection.x_dir)],
                HandleDirection.x_dir, True)
            self.handle_list.append(handle_b2)

        if (type == 3):

            join2_point += AllplanGeo.Point2D(0, 0)
            join2_point += AllplanGeo.Point2D(-j_c, 0)
            join2_point += AllplanGeo.Point2D(-j_c, j_d)
            join2_point += AllplanGeo.Point2D(0, j_a)
            join2_point += AllplanGeo.Point2D(0, 0)

            if not GeometryValidate.is_valid(join2_point):
                return

            path2 += AllplanGeo.Point3D(wall_length, 0, 0)
            path2 += AllplanGeo.Point3D(wall_length, 0, wall_width)

        err, join2 = AllplanGeo.CreatePolyhedron(join2_point, ref_pnt, path2)
        if not GeometryValidate.polyhedron(err):
            return

        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_stroke, join2))
        return join2
Exemple #21
0
    def shape_longitudinal_steel(self,
                                 bar_diameter,
                                 length,
                                 extend=0,
                                 bend_flag=False):
        '''
        纵筋建模函数
        
        Args:

        '''

        point_list = []

        if bend_flag:
            shape_type = AllplanReinf.BendingShapeType.Freeform
            if self.AnchorHeadBend:
                point_list.append(
                    (AllplanGeo.Point3D(-extend, self.B_VertAnchor, 0), 0))
                point_list.append(
                    (AllplanGeo.Point3D(-self.A_Anchor - self.B_HoriAnchor,
                                        self.B_VertAnchor, 0), 0))
                point_list.append((AllplanGeo.Point3D(-self.A_Anchor, 0,
                                                      0), 0))
                point_list.append((AllplanGeo.Point3D(0, 0, 0), 0))
                point_list.append((AllplanGeo.Point3D(length, 0, 0), 0))
                point_list.append((AllplanGeo.Point3D(length + extend, 0,
                                                      0), 0))

            if self.AnchorTailBend:
                point_list.append((AllplanGeo.Point3D(-extend, 0, 0), 0))
                point_list.append((AllplanGeo.Point3D(length, 0, 0), 0))
                point_list.append((AllplanGeo.Point3D(length + self.A_Anchor,
                                                      0, 0), 0))
                point_list.append((AllplanGeo.Point3D(
                    length + self.A_Anchor + self.B_HoriAnchor,
                    self.B_VertAnchor, 0), 0))
                point_list.append(
                    (AllplanGeo.Point3D(length + extend, self.B_VertAnchor,
                                        0), 0))
        else:
            shape_type = AllplanReinf.BendingShapeType.LongitudinalBar
            point_list.append((AllplanGeo.Point3D(-extend, 0, 0), 0))
            point_list.append((AllplanGeo.Point3D(length + extend, 0, 0), 0))

        shape_build = AllplanReinf.ReinforcementShapeBuilder()
        shape_build.AddPoints(point_list)

        rebar_prop = {
            'diameter': bar_diameter,
            'bending_roller': 0,
            'steel_grade': self.BarSteelGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': shape_type
        }
        shape_props = ReinforcementShapeProperties.rebar(**rebar_prop)
        shape = shape_build.CreateShape(shape_props)
        angle = RotationAngles(90, 0, 0)
        shape.Rotate(angle)
        if shape.IsValid():
            return shape
Exemple #22
0
    def create_geometry(self, build_ele):
        """
        Create the element geometries

        Args:
            build_ele:  the building element.
        """

        #----------------- Extract palette parameter values

        wall_length = build_ele.Length1_1.value
        wall_width = build_ele.Width1_1.value
        wall_thickness = build_ele.Thickness1_1.value

        void_active = build_ele.chkb_win.value
        door_active = build_ele.chkb_door.value

        join1_type_added = build_ele.join1_type_active.value
        join1_type_select = build_ele.join1_type.value

        join2_type_added = build_ele.join2_type_active.value
        join2_type_select = build_ele.join2_type.value

        #------------------------------------ Create wall------------------------------------------#

        wall = AllplanGeo.Polyhedron3D.CreateCuboid(wall_length,
                                                    wall_thickness, wall_width)
        trans_to_ref_point_1 = AllplanGeo.Matrix3D()
        trans_to_ref_point_1.Translate(AllplanGeo.Vector3D(0, 0, 0))
        wall = AllplanGeo.Transform(wall, trans_to_ref_point_1)

        #----------------------------Create Component Property--------------------------------------#
        com_prop_base_bodies = AllplanBaseElements.CommonProperties()
        com_prop_base_bodies.GetGlobalProperties()
        com_prop_base_bodies.Color = 1

        com_prop_stroke = AllplanBaseElements.CommonProperties()
        com_prop_stroke.GetGlobalProperties()
        com_prop_stroke.Stroke = 9  # dots
        com_prop_stroke.HelpConstruction = True

        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_stroke, wall))

        #------------------ Append Element to Wall -------------------------------------------------#
        if (void_active):
            void = self.add_windows(build_ele, com_prop_stroke, wall_length,
                                    wall_width, wall_thickness)
            err, wall = AllplanGeo.MakeSubtraction(wall, void)

        if (door_active):
            door = self.add_door(build_ele, com_prop_stroke, wall_length,
                                 wall_width, wall_thickness)
            err, wall = AllplanGeo.MakeSubtraction(wall, door)

        if (join1_type_added):
            join1 = self.add_joins_left(build_ele,
                                        com_prop_stroke,
                                        type=join1_type_select)
            err, wall = AllplanGeo.MakeSubtraction(wall, join1)

        if (join2_type_added):
            join2 = self.add_joins_right(build_ele,
                                         com_prop_stroke,
                                         type=join2_type_select)
            err, wall = AllplanGeo.MakeSubtraction(wall, join2)

        #---------------------------------------Add Wall Element----------------------------------------#
        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_base_bodies, wall))

        #-----------------------------------------------------------------------------------------------#
        #-----------------------------------------wall handle-------------------------------------------#
        #-----------------------------------------------------------------------------------------------#

        origin = AllplanGeo.Point3D(0, 0, 0)
        wall_plength = AllplanGeo.Point3D(wall_length, 0, 0)
        wall_pwidth = AllplanGeo.Point3D(0, 0, wall_width)
        wall_pthickness = AllplanGeo.Point3D(0, wall_thickness, 0)

        handle_walllength = HandleProperties(
            "WallMoveLength", wall_plength, origin,
            [("Length1_1", HandleDirection.x_dir)], HandleDirection.x_dir,
            True)
        self.handle_list.append(handle_walllength)

        handle_wallwidth = HandleProperties(
            "WallMoveWidth", wall_pwidth, origin,
            [("Width1_1", HandleDirection.z_dir)], HandleDirection.z_dir, True)
        self.handle_list.append(handle_wallwidth)

        handle_wallthickness = HandleProperties(
            "WallMoveThickness", wall_pthickness, origin,
            [("Thickness1_1", HandleDirection.y_dir)], HandleDirection.y_dir,
            True)
        self.handle_list.append(handle_wallthickness)
Exemple #23
0
    def create_reinforcement(self, build_ele):
        '''
        Create the reinforcement element
        构造并添加增强构建函数

        Args:
            build_ele: build_ele.get_parameter_dict()
            build_ele: .pyp文件内的 Name标签的参数字典
        '''
        reinforcement = []

        #参数
        #-箍筋参数
        high_den_distance = build_ele['HighDensityDistance']  #加密区间距
        low_den_distance = build_ele['LowDensityDistance']  #非加密区间距
        #-箍筋坐标
        head_high_den_point_f = AllplanGeo.Point3D(0, 0, 0)  #加密区头部起点
        head_high_den_point_t = AllplanGeo.Point3D(self.height * 2, 0,
                                                   0)  #加密区头部终点

        tail_high_den_point_f = AllplanGeo.Point3D(
            self.length - self.height * 2, 0, 0)  #加密区尾部起点
        tail_high_den_point_t = AllplanGeo.Point3D(self.length, 0, 0)  #加密区尾部终点

        low_den_point_f = AllplanGeo.Point3D(self.height * 2, 0, 0)  #非加密区起点
        low_den_point_t = AllplanGeo.Point3D(self.length - self.height * 2, 0,
                                             0)  #非加密区终点

        #-底筋参数
        bottom_bar_extend = build_ele['BottomBarExtendLength']  #底筋伸出长度
        bottom_bar_diameter = build_ele['BottomBarDiameter']  #底筋直径
        bottom_bar_cnt = build_ele['BottomBarCount']  #底筋数量
        bottom_bar_distance = build_ele['BottomBarDistance']  #底筋间距
        stir_concrete_cover = build_ele['StirrupConcreteCover']  #箍筋保护层厚度
        stir_diameter = build_ele['StirrupDiameter']  #箍筋直径
        #-底筋坐标
        bottom_bar_point_f = AllplanGeo.Point3D(
            0, stir_concrete_cover + stir_diameter + bottom_bar_diameter / 2,
            stir_concrete_cover + stir_diameter +
            bottom_bar_diameter / 2)  #底筋起点
        bottom_bar_point_t = AllplanGeo.Point3D(
            0, self.width - stir_concrete_cover - stir_diameter -
            bottom_bar_diameter / 2, stir_concrete_cover + stir_diameter +
            bottom_bar_diameter / 2)  #底筋终点

        #-顶筋参数
        top_bar_extend = build_ele['TopBarExtendLength']  #顶筋伸出长度
        top_bar_diameter = build_ele['TopBarDiameter']  #顶筋直径
        top_bar_cnt = build_ele['TopBarCount']  #顶筋数量
        top_bar_distance = build_ele['TopBarDistance']  #顶筋间距
        #-顶筋坐标
        f_top_bar_point_f = AllplanGeo.Point3D(
            0, stir_concrete_cover + stir_diameter + bottom_bar_diameter / 2,
            stir_concrete_cover + stir_diameter + bottom_bar_diameter / 2 +
            200)
        f_top_bar_point_t = AllplanGeo.Point3D(
            0, stir_concrete_cover + stir_diameter + bottom_bar_diameter / 2,
            self.height)
        b_top_bar_point_f = AllplanGeo.Point3D(
            0, self.width - stir_concrete_cover - stir_diameter -
            bottom_bar_diameter / 2, stir_concrete_cover + stir_diameter +
            bottom_bar_diameter / 2 + 200)
        b_top_bar_point_t = AllplanGeo.Point3D(
            0, self.width - stir_concrete_cover - stir_diameter -
            bottom_bar_diameter / 2, self.height)

        #构模
        shape_stirrup = self.shape_stirrup(build_ele)  #箍筋
        shape_bottom_bar = self.shape_bar(build_ele, bottom_bar_diameter,
                                          bottom_bar_extend)  #底筋
        shape_top_bar = self.shape_bar(build_ele, top_bar_diameter,
                                       top_bar_extend)  #顶筋

        #添加箍筋到加密区头部
        reinforcement.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, head_high_den_point_f, head_high_den_point_t,
                0, 0, high_den_distance))

        #添加箍筋到加密区尾部
        reinforcement.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                1, shape_stirrup, tail_high_den_point_f, tail_high_den_point_t,
                0, 0, high_den_distance))

        #添加箍筋到非加密区
        reinforcement.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                2, shape_stirrup, low_den_point_f, low_den_point_t, 0, 0,
                low_den_distance))

        #添加底筋到梁底部
        reinforcement.append(
            LinearBarBuilder.create_linear_bar_placement_from_by_dist_count(
                3, shape_bottom_bar, bottom_bar_point_f, bottom_bar_point_t, 0,
                bottom_bar_distance, bottom_bar_cnt))

        #添加前侧顶筋
        reinforcement.append(
            LinearBarBuilder.create_linear_bar_placement_from_by_dist_count(
                4, shape_top_bar, f_top_bar_point_f, f_top_bar_point_t, 0,
                top_bar_distance, top_bar_cnt))

        #添加后侧顶筋
        reinforcement.append(
            LinearBarBuilder.create_linear_bar_placement_from_by_dist_count(
                5, shape_top_bar, b_top_bar_point_f, b_top_bar_point_t, 0,
                top_bar_distance, top_bar_cnt))

        return reinforcement
Exemple #24
0
    def create_waist_steel(self):
        steel_list = []

        cover = ConcreteCoverProperties(self.StirSideCover + self.StirDiameter,
                                        self.StirSideCover + self.StirDiameter,
                                        0, 0)

        rebar_prop = {
            'diameter': self.WaistBarDiameter,
            'bending_roller': 0,
            'steel_grade': self.WaistBarSteelGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': AllplanReinf.BendingShapeType.LongitudinalBar
        }

        waist = LongitudinalSteel(cover, rebar_prop)

        if self.AnchorHead90_W and not self.AnchorTail90_W:
            waist_shape = waist.shape_hook_steel(length=self.Length,
                                                 hook=15 *
                                                 self.WaistBarDiameter,
                                                 left=self.AnchorHead_W,
                                                 right=self.AnchorTail_W,
                                                 rotate=90,
                                                 hook_side=4)
        elif not self.AnchorHead90_W and self.AnchorTail90_W:
            waist_shape = waist.shape_hook_steel(length=self.Length,
                                                 hook=15 *
                                                 self.WaistBarDiameter,
                                                 left=self.AnchorHead_W,
                                                 right=self.AnchorTail_W,
                                                 rotate=90,
                                                 hook_side=5)
        elif self.AnchorHead90_W and self.AnchorTail90_W:
            waist_shape = waist.shape_hook_steel(length=self.Length,
                                                 hook=15 *
                                                 self.WaistBarDiameter,
                                                 left=self.AnchorHead_W,
                                                 right=self.AnchorTail_W,
                                                 rotate=90,
                                                 hook_side=3)
        else:
            waist_shape = waist.shape_extend_steel(length=self.Length,
                                                   left=self.AnchorHead_W,
                                                   right=self.AnchorTail_W,
                                                   extend_side=3)

        distance = 0
        for x in range(self.WaistRows):
            W_point_f = AllplanGeo.Point3D(
                0, self.StirDiameter + self.StirSideCover,
                self.WaistPosition + distance)
            W_point_t = AllplanGeo.Point3D(
                0, self.Width - self.StirSideCover - self.StirDiameter,
                self.WaistPosition + distance)

            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                    0, waist_shape, W_point_f, W_point_t, 0, 0, 2))
            distance += self.WaistDistance

        return steel_list
Exemple #25
0
    def create_tie_steel(self):
        steel_list = []

        cover = ConcreteCoverProperties(self.StirSideCover + self.StirDiameter,
                                        self.StirSideCover + self.StirDiameter,
                                        0, 0)

        rebar_prop = {
            'diameter': self.TieBarDia,
            'bending_roller': 0,
            'steel_grade': self.TieBarGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': AllplanReinf.BendingShapeType.LongitudinalBar
        }

        tie = Stirrup(cover, rebar_prop)

        tie_shape = tie.shape_tie_steel(self.Width + 3 * self.StirDiameter +
                                        2 * self.TieBarDia,
                                        4 * self.TieBarDia,
                                        RotationAngles(225, 0, 90),
                                        hook=self.TieBendingLength,
                                        degrees=self.TieBarAngle)

        distance = 0
        for x in range(self.WaistRows):
            point_f_1 = AllplanGeo.Point3D(
                -self.StirDiameter, -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            point_t_1 = AllplanGeo.Point3D(
                self.StirDenseRegionLength - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)

            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_f_1, point_t_1, self.StirBothEndLength,
                    0, self.StirDenseRegionDistance, 3))

            point_f_2 = AllplanGeo.Point3D(
                self.Length - self.StirDenseRegionLength - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            point_t_2 = AllplanGeo.Point3D(
                self.Length - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_f_2, point_t_2, 0,
                    self.StirBothEndLength, self.StirDenseRegionDistance, 2))

            point_f = AllplanGeo.Point3D(
                self.StirDenseRegionLength - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            point_t = AllplanGeo.Point3D(
                self.Length - self.StirDenseRegionLength - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_f, point_t,
                    self.StirDenseRegionDistance / 2,
                    self.StirDenseRegionDistance / 2,
                    self.StirrupSparseRegionDistance, 3))

            if steel_modify(self.Length - 2 * self.StirDenseRegionLength,
                            self.StirDiameter,
                            self.StirrupSparseRegionDistance,
                            self.StirDenseRegionDistance / 2,
                            self.StirDenseRegionDistance / 2):
                point_cnt_1 = AllplanGeo.Point3D(self.StirDenseRegionLength, 0,
                                                 0)
                point_cnt_2 = AllplanGeo.Point3D(self.Length, 0, 0)
                vec = AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(0, 0, 0),
                    AllplanGeo.Point3D(self.StirrupSparseRegionDistance / 2, 0,
                                       0))
                s_shape = AllplanReinf.BendingShape(tie_shape)
                s_shape.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(
                            self.Length - self.StirDenseRegionLength -
                            self.StirDiameter,
                            -1.5 * self.StirDiameter - self.TieBarDia,
                            self.WaistPosition + self.WaistBarDiameter +
                            distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_cnt_1,
                                              point_cnt_2, s_shape))

            distance += self.WaistDistance

        return steel_list
Exemple #26
0
    def create_longitudinal_steel(self):
        steel_list = []

        cover = ConcreteCoverProperties(self.StirSideCover + self.StirDiameter,
                                        self.StirSideCover + self.StirDiameter,
                                        self.StirUpsCover + self.StirDiameter,
                                        self.StirUpsCover + self.StirDiameter)

        rebar_prop = {
            'bending_roller': 0,
            'steel_grade': self.SteelGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': AllplanReinf.BendingShapeType.LongitudinalBar
        }

        rebar_prop.update({'diameter': self.BarDiameter_B1})
        longit_B1 = LongitudinalSteel(cover, rebar_prop)
        rebar_prop.update({'diameter': self.BarDiameter_BO})
        longit_BO = LongitudinalSteel(cover, rebar_prop)
        rebar_prop.update({'diameter': self.BarDiameter_T1})
        longit_T1 = LongitudinalSteel(cover, rebar_prop)
        rebar_prop.update({'diameter': self.BarDiameter_TO})
        longit_TO = LongitudinalSteel(cover, rebar_prop)

        if self.AnchorHead90_T1 and not self.AnchorTail90_T1:
            T1_steel_shape = longit_T1.shape_hook_steel(
                self.Length,
                15 * self.BarDiameter_T1,
                left=self.AnchorHead_T1,
                right=self.AnchorTail_T1,
                hook_side=4,
                rotate=90,
                mirror=True)
        elif not self.AnchorHead90_T1 and self.AnchorTail90_T1:
            T1_steel_shape = longit_T1.shape_hook_steel(
                self.Length,
                15 * self.BarDiameter_T1,
                left=self.AnchorHead_T1,
                right=self.AnchorTail_T1,
                hook_side=5,
                rotate=90,
                mirror=True)
        elif self.AnchorHead90_T1 and self.AnchorTail90_T1:
            T1_steel_shape = longit_T1.shape_hook_steel(
                self.Length,
                15 * self.BarDiameter_T1,
                left=self.AnchorHead_T1,
                right=self.AnchorTail_T1,
                hook_side=3,
                rotate=90,
                mirror=True)
        else:
            T1_steel_shape = longit_B1.shape_extend_steel(
                self.Length,
                left=self.AnchorHead_T1,
                right=self.AnchorTail_T1,
                extend_side=3)

        T1_point_f = AllplanGeo.Point3D(
            0, self.StirDiameter + self.StirSideCover,
            self.Height - (self.StirUpsCover + self.StirDiameter))
        T1_point_t = AllplanGeo.Point3D(
            0, self.Width - self.StirSideCover - self.StirDiameter,
            self.Height - (self.StirUpsCover + self.StirDiameter))

        steel_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                0, T1_steel_shape, T1_point_f, T1_point_t, 0, 0,
                self.BarNumber_T1))

        if self.TopSecondRowLongBar:

            if self.AnchorHead90_TO and not self.AnchorTail90_TO:
                TO_steel_shape = longit_TO.shape_hook_steel(
                    self.Length,
                    15 * self.BarDiameter_TO,
                    left=self.AnchorHead_TO,
                    right=self.AnchorTail_TO,
                    hook_side=4,
                    rotate=90,
                    mirror=True)
            elif self.AnchorTail90_TO and not self.AnchorHead90_TO:
                TO_steel_shape = longit_TO.shape_hook_steel(
                    self.Length,
                    15 * self.BarDiameter_TO,
                    left=self.AnchorHead_TO,
                    right=self.AnchorTail_TO,
                    hook_side=5,
                    rotate=90,
                    mirror=True)
            elif self.AnchorHead90_TO and self.AnchorTail90_TO:
                TO_steel_shape = longit_TO.shape_hook_steel(
                    self.Length,
                    15 * self.BarDiameter_TO,
                    left=self.AnchorHead_TO,
                    right=self.AnchorTail_TO,
                    hook_side=3,
                    rotate=90,
                    mirror=True)
            else:
                TO_steel_shape = longit_TO.shape_extend_steel(
                    self.Length,
                    left=self.AnchorHead_TO,
                    right=self.AnchorTail_TO,
                    extend_side=3)

            TO_point_f = AllplanGeo.Point3D(
                0, self.StirDiameter + self.StirSideCover, self.Height -
                (self.StirUpsCover + self.StirDiameter + self.TopBarDistance))
            TO_point_t = AllplanGeo.Point3D(
                0, self.Width - self.StirSideCover - self.StirDiameter,
                self.Height -
                (self.StirUpsCover + self.StirDiameter + self.TopBarDistance))
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                    0, TO_steel_shape, TO_point_f, TO_point_t, 0, 0,
                    self.BarNumber_TO))

        if self.AnchorHead90_B1 and not self.AnchorTail90_B1:
            B1_steel_shape = longit_B1.shape_hook_steel(
                self.Length,
                15 * self.BarDiameter_B1,
                left=self.AnchorHead_B1,
                right=self.AnchorTail_B1,
                hook_side=4,
                rotate=90)

        elif self.AnchorTail90_B1 and not self.AnchorHead90_B1:
            B1_steel_shape = longit_B1.shape_hook_steel(
                self.Length,
                15 * self.BarDiameter_B1,
                left=self.AnchorHead_B1,
                right=self.AnchorTail_B1,
                hook_side=5,
                rotate=90)

        elif self.AnchorHead90_B1 and self.AnchorTail90_B1:
            B1_steel_shape = longit_B1.shape_hook_steel(
                self.Length,
                15 * self.BarDiameter_B1,
                left=self.AnchorHead_B1,
                right=self.AnchorTail_B1,
                hook_side=3,
                rotate=90)

        else:
            B1_steel_shape = longit_B1.shape_extend_steel(
                self.Length,
                left=self.AnchorHead_B1,
                right=self.AnchorTail_B1,
                extend_side=3)

        B1_point_f = AllplanGeo.Point3D(0,
                                        self.StirDiameter + self.StirSideCover,
                                        self.StirUpsCover + self.StirDiameter)
        B1_point_t = AllplanGeo.Point3D(
            0, self.Width - self.StirSideCover - self.StirDiameter,
            self.StirUpsCover + self.StirDiameter)

        steel_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                0, B1_steel_shape, B1_point_f, B1_point_t, 0, 0,
                self.BarNumber_B1))

        if self.BottomSecondRowLongBar:

            if self.AnchorHead90_BO and not self.AnchorTail90_BO:
                BO_steel_shape = longit_BO.shape_hook_steel(
                    self.Length,
                    15 * self.BarDiameter_BO,
                    left=self.AnchorHead_BO,
                    right=self.AnchorTail_BO,
                    hook_side=4,
                    rotate=90)
            elif self.AnchorTail90_BO and not self.AnchorHead90_BO:
                BO_steel_shape = longit_BO.shape_hook_steel(
                    self.Length,
                    15 * self.BarDiameter_BO,
                    left=self.AnchorHead_BO,
                    right=self.AnchorTail_BO,
                    hook_side=5,
                    rotate=90)
            elif self.AnchorHead90_BO and self.AnchorTail90_BO:
                BO_steel_shape = longit_BO.shape_hook_steel(
                    self.Length,
                    15 * self.BarDiameter_BO,
                    left=self.AnchorHead_BO,
                    right=self.AnchorTail_BO,
                    hook_side=3,
                    rotate=90)
            else:
                BO_steel_shape = longit_BO.shape_extend_steel(
                    self.Length,
                    left=self.AnchorHead_BO,
                    right=self.AnchorTail_BO,
                    extend_side=3)

            BO_point_f = AllplanGeo.Point3D(
                0, self.StirDiameter + self.StirSideCover,
                self.StirUpsCover + self.StirDiameter + self.BottomBarDistance)
            BO_point_t = AllplanGeo.Point3D(
                0, self.Width - self.StirSideCover - self.StirDiameter,
                self.StirUpsCover + self.StirDiameter + self.BottomBarDistance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_count(
                    0, BO_steel_shape, BO_point_f, BO_point_t, 0, 0,
                    self.BarNumber_BO))

        return steel_list
Exemple #27
0
    def create_stirrup(self):

        stirrup_list = []

        #构模
        shape_stirrup = self.shape_stirrup(self.StirrupType)

        point_f_1 = AllplanGeo.Point3D(0, 0, 0)
        point_t_1 = AllplanGeo.Point3D(self.StirDenseRegionLength, 0, 0)
        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, point_f_1, point_t_1, self.StirBothEndLength,
                0, self.StirDenseRegionDistance, 3))

        point_f_2 = AllplanGeo.Point3D(
            self.Length - self.StirDenseRegionLength, 0, 0)
        point_t_2 = AllplanGeo.Point3D(self.Length, 0, 0)
        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, point_f_2, point_t_2, 0,
                self.StirBothEndLength, self.StirDenseRegionDistance, 2))

        point_f = AllplanGeo.Point3D(self.StirDenseRegionLength, 0, 0)
        point_t = AllplanGeo.Point3D(self.Length - self.StirDenseRegionLength,
                                     0, 0)
        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, point_f, point_t,
                self.StirDenseRegionDistance / 2,
                self.StirDenseRegionDistance / 2,
                self.StirrupSparseRegionDistance, 3))

        if steel_modify(self.Length - 2 * self.StirDenseRegionLength,
                        self.StirDiameter, self.StirrupSparseRegionDistance,
                        self.StirDenseRegionDistance / 2,
                        self.StirDenseRegionDistance / 2):
            point_cnt_1 = AllplanGeo.Point3D(self.StirDenseRegionLength, 0, 0)
            point_cnt_2 = AllplanGeo.Point3D(self.Length, 0, 0)
            vec = AllplanGeo.Vector3D(
                AllplanGeo.Point3D(0, 0, 0),
                AllplanGeo.Point3D(self.StirrupSparseRegionDistance / 2, 0, 0))
            s_shape = AllplanReinf.BendingShape(shape_stirrup)
            s_shape.Move(
                AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(
                        self.Length - self.StirDenseRegionLength, 0, 0)))
            stirrup_list.append(
                AllplanReinf.BarPlacement(0, 1, vec, point_cnt_1, point_cnt_2,
                                          s_shape))

        return stirrup_list
Exemple #28
0
    def shape_keyslot(self,
                      length,
                      width,
                      height,
                      edge,
                      mirror=False,
                      rX=0,
                      rY=0,
                      rZ=0,
                      sX=0,
                      sY=0,
                      sZ=0):
        #bevel_edge = math.sqrt(self.KeyslotEdge^2 + self.KeyslotThick^2) #斜边

        if mirror:
            base_pol1 = AllplanGeo.Polygon3D()
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY + edge,
                                            rZ + sZ + edge)
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY + width - edge,
                                            rZ + sZ + edge)
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY + width - edge,
                                            rZ + sZ + height - edge)
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY + edge,
                                            rZ + sZ + height - edge)
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY + edge,
                                            rZ + sZ + edge)

            base_pol2 = AllplanGeo.Polygon3D()
            base_pol2 += AllplanGeo.Point3D(rX + sX + length, rY + sY, rZ + sZ)
            base_pol2 += AllplanGeo.Point3D(rX + sX + length, rY + sY + width,
                                            rZ + sZ)
            base_pol2 += AllplanGeo.Point3D(rX + sX + length, rY + sY + width,
                                            rZ + sZ + height)
            base_pol2 += AllplanGeo.Point3D(rX + sX + length, rY + sY,
                                            rZ + sZ + height)
            base_pol2 += AllplanGeo.Point3D(rX + sX + length, rY + sY, rZ + sZ)

        else:
            base_pol1 = AllplanGeo.Polygon3D()
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY, rZ + sZ)
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY + width, rZ + sZ)
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY + width,
                                            rZ + sZ + height)
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY, rZ + sZ + height)
            base_pol1 += AllplanGeo.Point3D(rX + sX, rY + sY, rZ + sZ)

            #----------------------------------

            base_pol2 = AllplanGeo.Polygon3D()
            base_pol2 += AllplanGeo.Point3D(rX + sX + length, rY + sY + edge,
                                            rZ + sZ + edge)
            base_pol2 += AllplanGeo.Point3D(rX + sX + length,
                                            rY + sY + width - edge,
                                            rZ + sZ + edge)
            base_pol2 += AllplanGeo.Point3D(rX + sX + length,
                                            rY + sY + width - edge,
                                            rZ + sZ + height - edge)
            base_pol2 += AllplanGeo.Point3D(rX + sX + length, rY + sY + edge,
                                            rZ + sZ + height - edge)
            base_pol2 += AllplanGeo.Point3D(rX + sX + length, rY + sY + edge,
                                            rZ + sZ + edge)

        if not GeometryValidate.is_valid(base_pol1):
            return
        if not GeometryValidate.is_valid(base_pol2):
            return

        err, shape = AllplanGeo.CreatePolyhedron(base_pol1, base_pol2)
        err, shape = AllplanGeo.CreateBRep3D(shape)
        return shape
Exemple #29
0
    def create_tie_steel(self):
        steel_list = []
        tie_shape = self.shape_tie_steel(self.Width, 4 * self.TieBarDia)

        distance = 0
        for x in range(self.WaistNum):
            point_f_x = AllplanGeo.Point3D(
                self.SlotLength + self.StirDiameter, 0,
                self.WaistPosition - 2 * self.TieBarDia + distance)
            point_t_x = AllplanGeo.Point3D(
                self.CutPosition + self.StirDiameter, 0,
                self.WaistPosition - 2 * self.TieBarDia + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_f_x, point_t_x, self.HeadCover,
                    self.EndCover, self.TieBarRatio * self.StirDistance, 3))
            if self.cut_pos_1 - self.last_pos_1 > self.StirDistance / 2 \
            and self.cut_pos_1 - self.last_pos_1 < self.StirDistance + self.StirDiameter:
                point_cnt_1 = AllplanGeo.Point3D(
                    self.last_pos_1 + self.StirDistance / 2, 0, 0)
                point_cnt_2 = AllplanGeo.Point3D(self.cut_pos_1, 0, 0)
                vec = AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(0, 0, 0),
                    AllplanGeo.Point3D(self.StirDistance / 2, 0, 0))
                s_shape = AllplanReinf.BendingShape(tie_shape)
                s_shape.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(
                            self.cut_pos_1 + self.StirDiameter, 0,
                            self.WaistPosition - 2 * self.TieBarDia +
                            distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_cnt_1,
                                              point_cnt_2, s_shape))

            distance += self.WaistDistance

        distance = 0
        for y in range(self.WaistNum):
            point_f_y = AllplanGeo.Point3D(
                self.CutPosition + self.CutLength + self.StirDiameter, 0,
                self.WaistPosition - 2 * self.TieBarDia + distance)
            point_t_y = AllplanGeo.Point3D(
                self.Length - self.SlotLength + self.StirDiameter, 0,
                self.WaistPosition - 2 * self.TieBarDia + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_t_y, point_f_y, self.HeadCover,
                    self.EndCover, self.TieBarRatio * self.StirDistance, 3))
            if self.cut_pos_2 - self.last_pos_2 > self.StirDistance / 2 \
            and self.cut_pos_2 - self.last_pos_2 < self.StirDistance + self.StirDiameter:
                point_cnt_3 = AllplanGeo.Point3D(
                    self.CutPosition + self.CutLength, 0, 0)
                point_cnt_4 = AllplanGeo.Point3D(self.Length - self.SlotLength,
                                                 0, 0)
                vec = AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(0, 0, 0),
                    AllplanGeo.Point3D(self.StirDistance / 2, 0, 0))
                s_shape = AllplanReinf.BendingShape(tie_shape)
                s_shape.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(
                            self.CutPosition + self.CutLength + self.EndCover +
                            self.StirDiameter, 0, self.WaistPosition -
                            2 * self.TieBarDia + distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_cnt_3,
                                              point_cnt_4, s_shape))

            distance += self.WaistDistance

        return steel_list
Exemple #30
0
    def create_stirrup(self):

        stirrup_list = []
        point_f_1 = AllplanGeo.Point3D(self.SlotLength, 0, 0)
        point_t_1 = AllplanGeo.Point3D(self.CutPosition, 0, 0)

        #构模
        shape_stirrup = self.shape_stirrup()  #箍筋
        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, point_f_1, point_t_1, self.HeadCover,
                self.EndCover, self.StirDistance, 3))

        #判断间距添加箍筋
        if self.cut_pos_1 - self.last_pos_1 > self.StirDistance / 2 \
        and self.cut_pos_1 - self.last_pos_1 < self.StirDistance + self.StirDiameter:
            point_cnt_1 = AllplanGeo.Point3D(
                self.last_pos_1 + self.StirDistance / 2, 0, 0)
            point_cnt_2 = AllplanGeo.Point3D(self.cut_pos_1, 0, 0)
            vec = AllplanGeo.Vector3D(
                AllplanGeo.Point3D(0, 0, 0),
                AllplanGeo.Point3D(self.StirDistance / 2, 0, 0))
            s_shape = AllplanReinf.BendingShape(shape_stirrup)
            s_shape.Move(
                AllplanGeo.Vector3D(AllplanGeo.Point3D(self.cut_pos_1, 0, 0)))
            stirrup_list.append(
                AllplanReinf.BarPlacement(0, 1, vec, point_cnt_1, point_cnt_2,
                                          s_shape))

        point_f_2 = AllplanGeo.Point3D(self.CutPosition + self.CutLength, 0, 0)
        point_t_2 = AllplanGeo.Point3D(self.Length - self.SlotLength, 0, 0)

        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                1, shape_stirrup, point_t_2, point_f_2, self.HeadCover,
                self.EndCover, self.StirDistance, 3))



        if self.cut_pos_2 - self.last_pos_2 > self.StirDistance / 2 \
        and self.cut_pos_2 - self.last_pos_2 < self.StirDistance + self.StirDiameter:
            point_cnt_3 = AllplanGeo.Point3D(self.CutPosition + self.CutLength,
                                             0, 0)
            point_cnt_4 = AllplanGeo.Point3D(self.Length - self.SlotLength, 0,
                                             0)
            vec = AllplanGeo.Vector3D(
                AllplanGeo.Point3D(0, 0, 0),
                AllplanGeo.Point3D(self.StirDistance / 2, 0, 0))
            s_shape = AllplanReinf.BendingShape(shape_stirrup)
            s_shape.Move(
                AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(
                        self.CutPosition + self.CutLength + self.EndCover, 0,
                        0)))
            stirrup_list.append(
                AllplanReinf.BarPlacement(0, 1, vec, point_cnt_3, point_cnt_4,
                                          s_shape))

        return stirrup_list