Ejemplo n.º 1
0
    def create_reinforcement(self, build_ele):
        '''
        Create the reinforcement element
        构造并添加增强构建函数

        Args:
            build_ele: the building element
            .pyp文件输入参数,buile_ele代表整个.pyp文件信息
        '''
        reinforcement = []
        stirrup = self.create_stirrup()
        longitudinal = self.create_longitudinal_steel()
        tie = self.create_tie_steel()

        for ele_1 in stirrup:
            ele_1.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet([
                        AllplanBaseElements.AttributeInteger(
                            1013, self.MarkIndex_Stir)
                    ])
                ]))

        for ele_2 in longitudinal:
            ele_2.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet([
                        AllplanBaseElements.AttributeInteger(
                            1013, self.MarkIndex_Vert)
                    ])
                ]))

        for ele_3 in tie:
            ele_3.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet([
                        AllplanBaseElements.AttributeInteger(
                            1013, self.MarkIndex_Tie)
                    ])
                ]))

        if self.StirrupVisual:
            reinforcement += stirrup
        if self.VertSteelVisual:
            reinforcement += longitudinal
        if self.TieSteelVisual:
            reinforcement += tie

        return reinforcement
Ejemplo n.º 2
0
    def create_attribute_list(self, value):
        """
        Create an attribute set

        Args:
            value:  double value for attribute 1832 Allfa Zahl03

        Returns:
            AllplanBaseElements.Attributes object filled with attributes
        """
        #------------------ Define attributes for elements
        attr_list = []
        attr_list.append(AllplanBaseElements.AttributeDouble(
            1832, value))  #Allfa Zahl03

        attr_set_list = []
        attr_set_list.append(AllplanBaseElements.AttributeSet(attr_list))

        attributes = AllplanBaseElements.Attributes(attr_set_list)
        return attributes
Ejemplo n.º 3
0
    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"))
Ejemplo n.º 4
0
    def create_reinforcement(self):
        '''
        Create the reinforcement element
        构造并添加增强构建函数

        Args:
            build_ele: the building element
            .pyp文件输入参数,buile_ele代表整个.pyp文件信息
        '''
        reinforcement = []
        horizon, vertical, tie = self.create_horizontal_steel(
        ), self.create_vertical_steel(), self.create_tie_steel()
        for ele_1 in horizon:
            ele_1.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet([
                        AllplanBaseElements.AttributeInteger(
                            1013, self.MarkIndex_Hori)
                    ])
                ]))
        for ele_2 in vertical:
            ele_2.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet([
                        AllplanBaseElements.AttributeInteger(
                            1013, self.MarkIndex_Vert)
                    ])
                ]))
        for ele_3 in tie:
            ele_3.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet([
                        AllplanBaseElements.AttributeInteger(
                            1013, self.MarkIndex_Tie)
                    ])
                ]))

        if self.HoriSteelVisual:
            reinforcement += horizon
        if self.VertSteelVisual:
            reinforcement += vertical
        if self.TieSteelVisual:
            reinforcement += tie

        return reinforcement
Ejemplo n.º 5
0
    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
Ejemplo n.º 6
0
    def __init__(self, doc):
        '''
        Initialisation of class Beam
        初始化函数
        Args:
            doc: Input document
            文档输入
        '''
        self.model_ele_list = None
        self.handle_list = []
        self.document = doc

        #获取画笔信息
        self.texturedef = None

        self.com_prop = AllplanBaseElements.CommonProperties()
        self.com_prop.GetGlobalProperties()
Ejemplo n.º 7
0
    def draw_preview(self, input_pnt, b_use_input_pnt):
        """
        Draw the preview

        Args:
            input_pnt:  Input point
        """
        if len(self.points) < 1:
            return

        if b_use_input_pnt == True:
            self.b_use_input_pnt = True
        else:
            self.b_use_input_pnt = False

        self.__create_model_element__(input_pnt)
        if not self.model_ele_list:
            return

        AllplanBaseElements.DrawElementPreview(
            self.coord_input.GetInputViewDocument(), AllplanGeo.Matrix3D(),
            self.model_ele_list, False, None)
Ejemplo n.º 8
0
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)
Ejemplo n.º 9
0
    def create_reinforcement(self):
        '''
        Create the reinforcement element
        构造并添加增强构建函数

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

        stir, longit, waist, tie = self.create_stirrup(
        ), self.create_longitudinal_steel(), self.create_waist_steel(
        ), self.create_tie_steel()

        for ele_1 in stir:
            ele_1.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet(
                        [AllplanBaseElements.AttributeInteger(1013, 10)])
                ]))
        for ele_2 in longit:
            ele_2.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet(
                        [AllplanBaseElements.AttributeInteger(1013, 11)])
                ]))
        for ele_3 in waist:
            ele_3.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet(
                        [AllplanBaseElements.AttributeInteger(1013, 12)])
                ]))
        for ele_4 in tie:
            ele_4.SetAttributes(
                AllplanBaseElements.Attributes([
                    AllplanBaseElements.AttributeSet(
                        [AllplanBaseElements.AttributeInteger(1013, 13)])
                ]))

        if self.StirrupVisual:
            reinforcement += stir
        if self.LongBarVisual:
            reinforcement += longit
        if self.WaistBarVisual:
            reinforcement += waist
        if self.TieBarVisual:
            reinforcement += tie
        return reinforcement
Ejemplo n.º 10
0
    def create_reinforcement(self):
        '''
        Create the reinforcement element
        构造并添加增强构建函数

        Args:

        '''

        ############################################################################################
        #calculate
        self.cut_pos_1 = self.CutPosition - self.EndCover  #左段切口位置
        self.last_pos_1 = int((self.CutPosition - self.SlotLength) / self.StirDistance)\
                         * self.StirDistance + self.HeadCover #左段最后一根箍筋位置
        self.cut_pos_2 = self.Length - self.SlotLength - (self.CutPosition + self.CutLength)\
                         - self.HeadCover - self.EndCover - self.StirDiameter #右段切口位置
        self.last_pos_2 = int((self.Length - self.SlotLength - (self.CutPosition + self.CutLength)\
                         - self.HeadCover - self.EndCover - self.StirDiameter) / self.StirDistance)\
                          * self.StirDistance #右段最后一根箍筋位置
        ############################################################################################

        com_prop = AllplanBaseElements.CommonProperties()
        com_prop.HelpConstruction = True
        reinforcement = []
        if self.StirVisual:
            stir = self.create_stirrup()
            for elem in stir:
                elem.SetAttributes(
                    AllplanBaseElements.Attributes([
                        AllplanBaseElements.AttributeSet(
                            [AllplanBaseElements.AttributeInteger(1013, 100)])
                    ]))
            reinforcement += stir
        if self.LongbarVisual:
            l = self.create_long_steel()
            for elem in l:
                elem.SetAttributes(
                    AllplanBaseElements.Attributes([
                        AllplanBaseElements.AttributeSet(
                            [AllplanBaseElements.AttributeInteger(1013, 101)])
                    ]))
            reinforcement += l
        if self.WaistVisual:
            waist = self.create_waist_steel()
            for elem in waist:
                elem.SetAttributes(
                    AllplanBaseElements.Attributes([
                        AllplanBaseElements.AttributeSet(
                            [AllplanBaseElements.AttributeInteger(1013, 102)])
                    ]))
            reinforcement += waist
        if self.TieBarVisual:
            tie = self.create_tie_steel()
            for elem in tie:
                elem.SetAttributes(
                    AllplanBaseElements.Attributes([
                        AllplanBaseElements.AttributeSet(
                            [AllplanBaseElements.AttributeInteger(1013, 103)])
                    ]))
            reinforcement += tie

        return reinforcement
Ejemplo n.º 11
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)