Exemple #1
0
    def pick_domain(self):
        # ask user for origin and max domain points
        with forms.WarningBar(title='Pick origin point (bottom-left '
                                    'corner of the pattern area):'):
            pat_bottomleft = revit.pick_point()
        if pat_bottomleft:
            with forms.WarningBar(title='Pick top-right corner '
                                        'of the pattern area:'):
                pat_topright = revit.pick_point()
            if pat_topright:
                return (MakePatternWindow.round_coord(pat_bottomleft.X),
                        MakePatternWindow.round_coord(pat_bottomleft.Y)), \
                       (MakePatternWindow.round_coord(pat_topright.X),
                        MakePatternWindow.round_coord(pat_topright.Y))

        return False
Exemple #2
0
    def pick_domain(self):
        def round_domain_coord(coord):
            return round(coord, PICK_COORD_RESOLUTION)

        # ask user for origin and max domain points
        with forms.WarningBar(title='Pick origin point (bottom-left '
                              'corner of the pattern area):'):
            pat_bottomleft = revit.pick_point()
        if pat_bottomleft:
            with forms.WarningBar(title='Pick top-right corner '
                                  'of the pattern area:'):
                pat_topright = revit.pick_point()
            if pat_topright:
                return (round_domain_coord(pat_bottomleft.X),
                        round_domain_coord(pat_bottomleft.Y)), \
                       (round_domain_coord(pat_topright.X),
                        round_domain_coord(pat_topright.Y))

        return False
Exemple #3
0
    def pick_domain(self):
        # ask user for origin and max domain points
        with forms.WarningBar(title='Pick origin point (bottom-left '
                              'corner of the pattern area):'):
            view = revit.active_view
            if not view.SketchPlane \
                    and not isinstance(view, DB.ViewDrafting):
                base_plane = \
                    DB.Plane.CreateByNormalAndOrigin(view.ViewDirection,
                                                     view.Origin)
                with revit.Transaction('Set Selection Plane'):
                    pick_plane = DB.SketchPlane.Create(revit.doc, base_plane)
                    view.SketchPlane = pick_plane
            pat_bottomleft = revit.pick_point()
        if pat_bottomleft:
            with forms.WarningBar(title='Pick top-right corner '
                                  'of the pattern area:'):
                pat_topright = revit.pick_point()
            if pat_topright:
                return self.make_pattern_line(pat_bottomleft, pat_topright)

        return False