Exemplo n.º 1
0
def create_region(view, X, Y, region_width_cm=120, region_height_cm=60):

    # VARIABLES
    region_width = convert_cm_to_feet(region_width_cm)
    region_height = convert_cm_to_feet(region_height_cm)
    region_type_id = doc.GetDefaultElementTypeId(
        ElementTypeGroup.FilledRegionType)

    # CONTAINER
    elements_line_text = []

    # REGION POINTS
    points_0 = XYZ(X, Y, 0.0)
    points_1 = XYZ(X + region_width, Y, 0.0)
    points_2 = XYZ(X + region_width, Y - region_height, 0.0)
    points_3 = XYZ(X, Y - region_height, 0.0)
    points = [points_0, points_1, points_2, points_3, points_0]

    # CREATE BOUNDARY
    list_boundary = List[CurveLoop]()
    boundary = CurveLoop()

    for n, point in enumerate(points):
        if n == 4: break
        # LINE POINTS
        p1, p2 = points[n], points[n + 1]
        # LINE
        boundary.Append(Line.CreateBound(p1, p2))
    list_boundary.Add(boundary)

    filled_region = FilledRegion.Create(doc, region_type_id, view.Id,
                                        list_boundary)
    return filled_region
Exemplo n.º 2
0
    def overview_linepatterns(self):
        """Function to generate a drafting view with overview of all LinePatterns."""
        print("===CREATING OVERVIEW - LINEPATTERNS==")
        # GET ALL LINE PATTERNS
        all_line_patterns = list(
            FilteredElementCollector(doc).OfClass(
                LinePatternElement).ToElements())
        all_line_patterns.sort(key=lambda x: x.Name, reverse=False)

        # CREATE VIEW
        view = self.create_drafting_view()
        elements = self.create_lines_and_text_in_view(
            view, n_lines=len(all_line_patterns))
        #CREATE TEXT NOTE
        title_text = TextNote.Create(
            doc, view.Id,
            XYZ(0, convert_cm_to_feet(float(self.UI_line_spacing.Text)), 0),
            'Line Patterns:', self.selected_text_type.Id)

        for n, lp in enumerate(all_line_patterns):
            # GET ELEMENTS
            line = elements[n][0]
            text_note = elements[n][1]

            # CHANGE TEXT
            text_note.Text = lp.Name

            #OVERRIDE LINE
            override_settings = OverrideGraphicSettings()
            override_settings.SetProjectionLinePatternId(lp.Id)
            view.SetElementOverrides(line.Id, override_settings)

        # RENAME VIEW
        rename_view(view, view_name='py_Overview - LinePatterns')
        self.new_views.append(view)
Exemplo n.º 3
0
    def create_lines_and_text_in_view(self, view, n_lines):
        """Function to create lines and text notes(optonal) in the given view."""
        # VARIABLES
        line_width = convert_cm_to_feet(float(self.UI_line_width.Text))
        line_spacing = convert_cm_to_feet(float(self.UI_line_spacing.Text))
        text_spacing = line_width + line_spacing
        text_size = self.selected_text_type.get_Parameter(
            BuiltInParameter.TEXT_SIZE).AsDouble()

        # CONTAINER
        elements_line_text = []

        # CREATE LINE DEFAULT ELEMENTS
        line_constructor = Line.CreateBound(XYZ(0, 0, 0),
                                            XYZ(line_width, 0, 0))
        default_line = doc.Create.NewDetailCurve(view, line_constructor)
        default_text_note = TextNote.Create(
            doc, view.Id, XYZ(text_spacing, text_size * 100,
                              0), 'Default TextNote',
            self.selected_text_type.Id)  # Y adjusted for scale. Text * 100

        # CREATE LIST[ElementId]
        default_elements = List[ElementId](
            [default_line.Id, default_text_note.Id])

        for n in range(n_lines):
            # LOCATION POINT
            offset = -line_spacing * (n + 1)
            copy_location = XYZ(0, offset, 0)

            # COPY ELEMENTS
            new_elements = ElementTransformUtils.CopyElements(
                doc, default_elements, copy_location)
            new_textnote = doc.GetElement(new_elements[1]) if type(
                doc.GetElement(
                    new_elements[1])) == TextNote else doc.GetElement(
                        new_elements[0])
            new_line = doc.GetElement(
                new_elements[0]) if type(doc.GetElement(
                    new_elements[0])) != TextNote else doc.GetElement(
                        new_elements[1])

            elements_line_text.append((new_line, new_textnote))
        # DELETE DEFAULT ELEMENTS
        doc.Delete(default_elements)

        return elements_line_text
Exemplo n.º 4
0
    def overview_lineweights(self):
        """Function to create multiple DraftingViews with overview of LineWeights."""
        print("===CREATING OVERVIEW - LINEWEIGHTS==")

        # VARIABLES
        # scales = [10, 25, 50, 100, 200, 500]
        scales = [int(i) for i in self.UI_line_weights.Text.split(',')]

        if not scales:
            return

        for scale in scales:
            # VARIABLES
            line_spacing_cm = float(self.UI_line_spacing.Text)
            line_spacing_feet = convert_cm_to_feet(line_spacing_cm)

            # CREATE VIEW
            view = self.create_drafting_view()
            lines = self.create_lines_in_view(view, n_lines=16, scale=scale)

            # CREATE LINE WEIGHT TEXT IN FIRST SCALE
            if scale == scales[0]:
                # new_title_text = TextNote.Create(doc, view.Id, XYZ(0, line_spacing_feet, 0), 'Line Weights:', self.selected_text_type.Id)
                text_size = self.selected_text_type.get_Parameter(
                    BuiltInParameter.TEXT_SIZE).AsDouble() * scale
                for n in range(16):
                    text_spacing = -line_spacing_feet * (n + 1) / scale
                    text_note = TextNote.Create(
                        doc, view.Id, XYZ(-0.4, text_spacing + text_size, 0),
                        str(n + 1), self.selected_text_type.Id)

            # LOOP THROUGH ELEMENTS
            for n in range(16):
                # CREATE TITLE TEXT
                text_note = TextNote.Create(
                    doc, view.Id, XYZ(0, line_spacing_feet * scale / 100, 0),
                    "1:{}".format(scale), self.selected_text_type.Id)
                line = lines[n]

                #OVERRIDE LINE
                override_settings = OverrideGraphicSettings()
                override_settings.SetProjectionLineWeight(n + 1)
                view.SetElementOverrides(line.Id, override_settings)

            # SET SCALE
            view.Scale = scale
            # RENAME VIEW
            rename_view(view,
                        view_name='py_Overview - LineWeights ' + str(scale))
            self.new_views.append(view)
Exemplo n.º 5
0
    def create_lines_in_view(self, view, n_lines, scale=100):
        """Function to create lines and text notes(optonal) in the given view."""
        # VARIABLES
        line_width = convert_cm_to_feet(
            float(self.UI_line_width.Text) * scale / 100)
        line_spacing = convert_cm_to_feet(
            float(self.UI_line_spacing.Text) * scale / 100)

        # CONTAINER
        new_lines = []

        # CREATE LINE DEFAULT ELEMENTS
        line_constructor = Line.CreateBound(XYZ(0, 0, 0),
                                            XYZ(line_width, 0, 0))
        default_line = doc.Create.NewDetailCurve(view, line_constructor)

        # CREATE LIST[ElementId]
        default_elements = List[ElementId]([
            default_line.Id,
        ])

        for n in range(n_lines):
            # LOCATION POINT
            offset = -line_spacing * (n + 1)
            copy_location = XYZ(0, offset, 0)

            # COPY ELEMENTS
            new_elements_id = ElementTransformUtils.CopyElements(
                doc, default_elements, copy_location)
            new_line = doc.GetElement(new_elements_id[0])

            new_lines.append(new_line)
        # DELETE DEFAULT ELEMENTS
        doc.Delete(default_elements)

        return new_lines
Exemplo n.º 6
0
    def overview_drafting_patterns(self):
        print("===CREATING OVERVIEW - DRAFTING PATTERNS==")

        # GET ALL DRAFTING PATTERNS AND SORT
        all_filled_patterns = FilteredElementCollector(doc).OfClass(
            FillPatternElement).ToElements()
        all_drafting_filled_patterns = [
            i for i in all_filled_patterns
            if str(i.GetFillPattern().Target) == "Drafting"
        ]
        all_drafting_filled_patterns.sort(key=lambda x: x.Name, reverse=False)

        # CREATE VIEW
        view = self.create_drafting_view()
        elements = self.create_regions_and_text_in_view(
            view, n_regions=len(all_drafting_filled_patterns))
        #CREATE TEXT NOTE
        title_text = TextNote.Create(
            doc, view.Id,
            XYZ(0, convert_cm_to_feet(float(self.UI_region_spacing.Text)), 0),
            'Drafting Patterns:', self.selected_text_type.Id)

        for n, filled_pattern in enumerate(all_drafting_filled_patterns):
            # GET ELEMENTS
            region = elements[n][0]
            text_note = elements[n][1]

            # CHANGE TEXT
            text_note.Text = filled_pattern.Name

            # APPLY DRAFTING FILLED PATTERN TO REGION
            override_settings = OverrideGraphicSettings()
            override_settings.SetSurfaceForegroundPatternId(filled_pattern.Id)
            override_settings.SetSurfaceForegroundPatternColor(Color(0, 0, 0))
            view.SetElementOverrides(region.Id, override_settings)

        # RENAME VIEW
        rename_view(view, view_name='py_Overview - DraftingPatterns')
        self.new_views.append(view)
Exemplo n.º 7
0
    def overview_linestyles(self):
        """Function to generate a drafting view with overview of all LinePatterns."""
        print("===CREATING OVERVIEW - LINESTYLES==")

        # GET ALL LINE STYLES
        all_line_styles_ids = list(self.get_line_styles_id())
        all_line_styles_ids.sort(key=lambda x: doc.GetElement(x).Name,
                                 reverse=False)

        # CREATE VIEW
        view = self.create_drafting_view()
        elements = self.create_lines_and_text_in_view(
            view, n_lines=len(all_line_styles_ids))

        #CREATE TEXT NOTE
        title_text = TextNote.Create(
            doc, view.Id,
            XYZ(0, convert_cm_to_feet(float(self.UI_line_spacing.Text)), 0),
            'Line Styles:', self.selected_text_type.Id)

        # LOOP THROUGH LINE STYLES
        for n, line_style_id in enumerate(all_line_styles_ids):
            line_style = doc.GetElement(line_style_id)

            # GET ELEMENTS
            line = elements[n][0]
            text_note = elements[n][1]

            # APPLY LINE STYLE
            line_param_line_style = line.get_Parameter(
                BuiltInParameter.BUILDING_CURVE_GSTYLE)
            line_param_line_style.Set(line_style_id)

            # CHANGE TEXT
            text_note.Text = line_param_line_style.AsValueString()

        # RENAME VIEW
        rename_view(view, view_name='py_Overview - LineStyles')
        self.new_views.append(view)
Exemplo n.º 8
0
    def overview_regions(self):
        print("===CREATING OVERVIEW - FILLED REGIONS==")
        # GET ALL FILLED REGIONS AND SORT
        all_filled_regions_types = list(
            FilteredElementCollector(doc).OfClass(
                FilledRegionType).ToElements())
        all_filled_regions_types.sort(key=lambda x: x.get_Parameter(
            BuiltInParameter.ALL_MODEL_TYPE_NAME).AsString(),
                                      reverse=False)

        # CREATE VIEW
        view = self.create_drafting_view()
        elements = self.create_regions_and_text_in_view(
            view, n_regions=len(all_filled_regions_types))

        #CREATE TEXT NOTE
        title_text = TextNote.Create(
            doc, view.Id,
            XYZ(0, convert_cm_to_feet(float(self.UI_region_spacing.Text)), 0),
            'Filled Regions:', self.selected_text_type.Id)

        for n, filled_region_type in enumerate(all_filled_regions_types):
            # GET ELEMENTS
            region = elements[n][0]
            text_note = elements[n][1]

            # CHANGE TEXT
            text_note.Text = filled_region_type.get_Parameter(
                BuiltInParameter.ALL_MODEL_TYPE_NAME).AsString()

            # CHANGE TYPE
            region.ChangeTypeId(filled_region_type.Id)

        # RENAME VIEW
        rename_view(view, view_name='py_Overview - FilledRegions')
        self.new_views.append(view)
Exemplo n.º 9
0
    def button_run(self, sender, e):
        self.Close()
        self.selected_text_type = self.get_selected_text_type()
        self.selected_views = self.get_selected_views()

        # LOOP THROUGH SELECTED VIEWS
        for view in self.selected_views:
            X = 0.0
            Y = 0.0

            # Create Legend
            legend_name = 'Legend_{}'.format(view.Name)
            legend_view = self.create_legend_view(legend_name)

            # Region Parameters
            region_width        = convert_cm_to_feet(float(self.UI_region_width.Text))
            region_height       = convert_cm_to_feet(float(self.UI_region_height.Text))
            region_spacing      = convert_cm_to_feet(float(self.UI_region_spacing.Text))
            line_width          = convert_cm_to_feet((float(self.UI_line_width.Text)))

            text_offset         = region_width + region_spacing

            # ╦ ╦╔═╗╔═╗╔╦╗╔═╗╦═╗╔═╗
            # ╠═╣║╣ ╠═╣ ║║║╣ ╠╦╝╚═╗
            # ╩ ╩╚═╝╩ ╩═╩╝╚═╝╩╚═╚═╝ HEADERS
            # ==================================================
            header_line_surface    = create_text_note(doc, legend_view, X               , Y+text_offset, 'Surface:'     , self.selected_text_type, bold=True)
            header_line_cut        = create_text_note(doc, legend_view, X+text_offset   , Y+text_offset, 'Cut:'         , self.selected_text_type, bold=True)
            header_region_surface  = create_text_note(doc, legend_view, X+text_offset*2 , Y+text_offset, 'Surface:'     , self.selected_text_type, bold=True)
            header_region_cut      = create_text_note(doc, legend_view, X+text_offset*3 , Y+text_offset, 'Cut:'         , self.selected_text_type, bold=True)
            header_Name            = create_text_note(doc, legend_view, X+text_offset*4 , Y+text_offset, 'FilterName:'  , self.selected_text_type, bold=True)
            header_categories      = create_text_note(doc, legend_view, X+text_offset*6 , Y+text_offset, 'FilterCategories', self.selected_text_type, bold=True)
            header_rule_param      = create_text_note(doc, legend_view, X+text_offset*8 , Y+text_offset, 'RuleParameter:'  , self.selected_text_type, bold=True)
            header_rule_eval       = create_text_note(doc, legend_view, X+text_offset*11 , Y+text_offset, 'RuleEvaluator:' , self.selected_text_type, bold=True)
            header_rule_value      = create_text_note(doc, legend_view, X+text_offset*13 , Y+text_offset, 'RuleValue:'     , self.selected_text_type, bold=True)


            # GET AND SORT FILTERS
            view_filters_ids = view.GetFilters()
            view_filters = [doc.GetElement(id) for id in view_filters_ids]
            view_filters.sort(key=lambda x: x.Name, reverse=False)

            #Loop through Filters
            try:
                for filter in view_filters:
                    X = 0.0

                    # ╦  ╦╔╗╔╔═╗╔═╗
                    # ║  ║║║║║╣ ╚═╗
                    # ╩═╝╩╝╚╝╚═╝╚═╝ LINES
                    # ==================================================
                    line_surf = create_horizontal_line(doc, legend_view, X, Y - region_height/2, line_width)
                    X += text_offset

                    line_cut  = create_horizontal_line(doc, legend_view, X, Y - region_height/2, line_width)
                    X += text_offset


                    # ╔═╗╦═╗╔═╗╔═╗╔╦╗╔═╗  ╦═╗╔═╗╔═╗╦╔═╗╔╗╔╔═╗
                    # ║  ╠╦╝║╣ ╠═╣ ║ ║╣   ╠╦╝║╣ ║ ╦║║ ║║║║╚═╗
                    # ╚═╝╩╚═╚═╝╩ ╩ ╩ ╚═╝  ╩╚═╚═╝╚═╝╩╚═╝╝╚╝╚═╝ CREATE REGIONS
                    # ==================================================


                    # GET OVERRIDE GRAPHICS
                    filter_overrides = view.GetFilterOverrides(filter.Id)

                    # SURFACE
                    region_surface  = create_region(doc, legend_view, X, Y, region_width, region_height)

                    surf_foreground_color       = filter_overrides.SurfaceForegroundPatternColor
                    surf_foreground_pattern_id  = filter_overrides.SurfaceForegroundPatternId
                    surf_background_color       = filter_overrides.SurfaceBackgroundPatternColor
                    surf_background_pattern_id  = filter_overrides.SurfaceBackgroundPatternId

                    surf_line_color             = filter_overrides.ProjectionLineColor
                    surf_line_pattern_id        = filter_overrides.ProjectionLinePatternId
                    surf_lineweight             = filter_overrides.ProjectionLineWeight

                    override_graphics_region(doc, legend_view, region_surface,
                                            fg_pattern_id    = surf_foreground_pattern_id,
                                            fg_color         = surf_foreground_color,
                                            bg_pattern_id    = surf_background_pattern_id,
                                            bg_color         = surf_background_color,
                                            line_color       = surf_line_color,
                                            line_pattern_id  = surf_line_pattern_id,
                                            lineweight       = surf_lineweight)

                    override_graphics_line(doc, legend_view, line_surf,
                                           line_color      = surf_line_color,
                                           line_pattern_id = surf_line_pattern_id,
                                           lineweight      = surf_lineweight)
                    X += text_offset

                    # CUT
                    region_cut      = create_region(doc, legend_view, X, Y, region_width, region_height)

                    cut_foreground_color        = filter_overrides.CutForegroundPatternColor
                    cut_foreground_pattern_id   = filter_overrides.CutForegroundPatternId
                    cut_background_color        = filter_overrides.CutBackgroundPatternColor
                    cut_background_pattern_id   = filter_overrides.CutBackgroundPatternId

                    cut_line_color              = filter_overrides.CutLineColor
                    cut_line_pattern_id         = filter_overrides.CutLinePatternId
                    cut_lineweight              = filter_overrides.CutLineWeight

                    override_graphics_region(doc, legend_view, region_cut,
                                             fg_pattern_id   = cut_foreground_pattern_id,
                                             fg_color        = cut_foreground_color,
                                             bg_pattern_id   = cut_background_pattern_id,
                                             bg_color        = cut_background_color,
                                             line_color      = cut_line_color,
                                             line_pattern_id = cut_line_pattern_id,
                                             lineweight      = cut_lineweight)

                    override_graphics_line(doc, legend_view, line_cut,
                                           line_color       = cut_line_color,
                                           line_pattern_id  = cut_line_pattern_id,
                                           lineweight       = cut_lineweight)
                    X += text_offset

                    # FILTER NAME
                    text_filter_name = create_text_note(doc, legend_view, X, Y, filter.Name, self.selected_text_type)
                    X += text_offset*2

                    try:
                        my_filter = ef_Filter(filter)

                        # CATEGORIES
                        categories = ', '.join(my_filter.cat_names)
                        text_category = create_text_note(doc, legend_view, X, Y, categories, self.selected_text_type)
                        X += text_offset * 2

                        # RULES
                        rules = my_filter.rules

                        if len(rules) == 1:
                            rule = rules[0]
                            rule_param_name = rule.rule_param_name
                            rule_eval       = rule.rule_eval
                            rule_value      = str(rule.rule_value)

                        elif len(rules) == 0:
                            no_rules        = '[No-Rules]'
                            rule_param_name = no_rules
                            rule_eval       = no_rules
                            rule_value      = no_rules

                        else:
                            multi_rules     = '[Multi-Rules]'
                            rule_param_name = multi_rules
                            rule_eval       = multi_rules
                            rule_value      = multi_rules


                        # WRITE RULE PARAMETER NAME
                        text_category = create_text_note(doc, legend_view, X, Y, rule_param_name, self.selected_text_type)
                        X += text_offset * 3
                        # WRITE RULE EVALUATOR
                        text_category = create_text_note(doc, legend_view, X, Y, rule_eval      , self.selected_text_type)
                        X += text_offset * 2
                        # WRITE RULE VALUE
                        text_category = create_text_note(doc, legend_view, X, Y, rule_value     , self.selected_text_type)
                        X += text_offset * 2

                    except:
                        import traceback
                        print(traceback.format_exc())

                    Y -= region_spacing + region_height

            except:
                print("Failed to parse the rule. Please submit screenshot with description to: https://github.com/ErikFrits/EF-Tools/issues")
                import traceback
                print(traceback.format_exc())
Exemplo n.º 10
0
    def create_regions_and_text_in_view(self, view, n_regions):
        """Function to add Regions and TextNotes to the given view.
        :param view:            DraftingView where to draw everything.
        :param n_regions:       Number of Regions
        :param region_width:    Width(cm) of single Region
        :param region_height:   Height(cm) of single Region
        :param region_spacing:  Spacing(cm) between regions
        :return:                List of tuples(region, text)
        """
        # VARIABLES

        region_width = convert_cm_to_feet(float(self.UI_region_width.Text))
        region_height = convert_cm_to_feet(float(self.UI_region_height.Text))
        region_spacing = convert_cm_to_feet(float(self.UI_region_spacing.Text))

        # CONTAINER
        elements_line_text = []

        # CREATE DEFAULT ELEMENTS

        # REGION
        points_0 = XYZ(0.0, 0.0, 0.0)
        points_1 = XYZ(region_width, 0.0, 0.0)
        points_2 = XYZ(region_width, region_height, 0.0)
        points_3 = XYZ(0.0, region_height, 0.0)
        points = [points_0, points_1, points_2, points_3, points_0]

        list_boundary = List[CurveLoop]()
        boundary = CurveLoop()

        for n, point in enumerate(points):
            if n == 4: break

            # LINE POINTS
            p1, p2 = points[n], points[n + 1]

            # LINE
            boundary.Append(Line.CreateBound(p1, p2))

        list_boundary.Add(boundary)

        region_type_id = doc.GetDefaultElementTypeId(
            ElementTypeGroup.FilledRegionType)
        filled_region = FilledRegion.Create(doc, region_type_id, view.Id,
                                            list_boundary)

        # TEXTNOTE
        text_note_type = doc.GetDefaultElementTypeId(
            ElementTypeGroup.TextNoteType)
        default_text_note = TextNote.Create(
            doc, view.Id,
            XYZ(region_width + region_spacing, region_height - 0.25, 0),
            'Default TextNote', self.selected_text_type.Id)

        # CREATE LIST[ElementId]
        default_elements = List[ElementId](
            [filled_region.Id, default_text_note.Id])

        for n in range(n_regions):
            # LOCATION POINT
            offset = (-region_spacing - region_height) * (n + 1)
            copy_location = XYZ(0, offset, 0)

            # COPY ELEMENTS
            new_elements = ElementTransformUtils.CopyElements(
                doc, default_elements, copy_location)
            new_textnote = doc.GetElement(new_elements[1]) if type(
                doc.GetElement(
                    new_elements[1])) == TextNote else doc.GetElement(
                        new_elements[0])
            new_region = doc.GetElement(
                new_elements[0]) if type(doc.GetElement(
                    new_elements[0])) != TextNote else doc.GetElement(
                        new_elements[1])

            elements_line_text.append((new_region, new_textnote))

        # DELETE DEFAULT ELEMENTS
        doc.Delete(default_elements)

        return elements_line_text
Exemplo n.º 11
0
    def __init__(self,
                 view,
                 material,
                 region_height_cm,
                 region_width_cm,
                 region_spacing_cm,
                 text_column_width_cm,
                 text_type,
                 row=0):
        self.row = row
        self.view = view
        self.material = material
        self.name = material.Name

        self.material_category = material.MaterialCategory

        self.region_height_feet = convert_cm_to_feet(region_height_cm)
        self.region_width_feet = convert_cm_to_feet(region_width_cm)
        self.region_spacing_feet = convert_cm_to_feet(region_spacing_cm)
        self.text_column_width_feet = convert_cm_to_feet(text_column_width_cm)
        self.text_type_id = text_type.Id

        self.region_spacing_X = self.region_width_feet + self.region_spacing_feet
        self.region_spacing_Y = self.region_height_feet + self.region_spacing_feet

        # ╦╔╦╗╔═╗╔╗╔╔╦╗╔═╗╔╦╗╦ ╦  ╔╦╗╔═╗╔╦╗╔═╗
        # ║ ║║║╣ ║║║ ║ ║╣  ║ ╚╦╝   ║║╠═╣ ║ ╠═╣
        # ╩═╩╝╚═╝╝╚╝ ╩ ╚═╝ ╩  ╩   ═╩╝╩ ╩ ╩ ╩ ╩ IDENTETY DATA
        # ==================================================
        self.material_description = material.get_Parameter(
            BuiltInParameter.ALL_MODEL_DESCRIPTION).AsString()
        self.material_class = material.MaterialClass
        self.material_comments = material.get_Parameter(
            BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS).AsString()

        # ╔═╗╦ ╦╔═╗╔╦╗╦╔╗╔╔═╗
        # ╚═╗╠═╣╠═╣ ║║║║║║║ ╦
        # ╚═╝╩ ╩╩ ╩═╩╝╩╝╚╝╚═╝ SHADING
        # ==================================================
        self.colour = material.Color

        # ╔═╗╦ ╦╦═╗╔═╗╔═╗╔═╗╔═╗
        # ╚═╗║ ║╠╦╝╠╣ ╠═╣║  ║╣
        # ╚═╝╚═╝╩╚═╚  ╩ ╩╚═╝╚═╝ SURFACE
        # ==================================================

        self.surf_foreground_color = material.SurfaceForegroundPatternColor
        self.surf_foreground_pattern_id = material.SurfaceForegroundPatternId
        self.surf_background_color = material.SurfaceBackgroundPatternColor
        self.surf_background_pattern_id = material.SurfaceBackgroundPatternId

        # ╔═╗╦ ╦╔╦╗
        # ║  ║ ║ ║
        # ╚═╝╚═╝ ╩ CUT
        # ==================================================
        self.cut_foreground_color = material.CutForegroundPatternColor
        self.cut_foreground_pattern_id = material.CutForegroundPatternId
        self.cut_background_color = material.CutBackgroundPatternColor
        self.cut_background_pattern_id = material.CutBackgroundPatternId

        # WRITE HEADERS
        if self.row == 0:
            self.write_headers()
        # WRITE ROW
        self.write_row()