Пример #1
0
    def __init__(self, xaml_file_name):
        forms.WPFWindow.__init__(self, xaml_file_name)

        self.sheet_cat_id = \
            revit.query.get_category(DB.BuiltInCategory.OST_Sheets).Id

        self._setup_printers()
        self._setup_print_settings()
        self.schedules_cb.ItemsSource = self._get_sheet_index_list()
        if not self.schedules_cb.ItemsSource:
            forms.alert("No Sheet Lists (Schedules) found in current project",
                        exitscript=True)
        self.schedules_cb.SelectedIndex = 0

        item_cstyle = self.sheets_lb.ItemContainerStyle

        item_cstyle.Setters.Add(
            Windows.Setter(Windows.Controls.ListViewItem.AllowDropProperty,
                           True))

        item_cstyle.Setters.Add(
            Windows.EventSetter(
                Windows.Controls.ListViewItem.PreviewMouseLeftButtonDownEvent,
                Windows.Input.MouseButtonEventHandler(
                    self.preview_mouse_down)))

        item_cstyle.Setters.Add(
            Windows.EventSetter(Windows.Controls.ListViewItem.DropEvent,
                                Windows.DragEventHandler(self.drop_sheet)))
Пример #2
0
    def __init__(self, xaml_file_name):
        forms.WPFWindow.__init__(self, xaml_file_name)

        for cat in revit.doc.Settings.Categories:
            if cat.Name == 'Sheets':
                self.sheet_cat_id = cat.Id

        self._setup_printers()
        self._setup_print_settings()
        self.schedules_cb.ItemsSource = self._get_sheet_index_list()
        self.schedules_cb.SelectedIndex = 0

        item_cstyle = self.sheets_lb.ItemContainerStyle

        item_cstyle.Setters.Add(
            Windows.Setter(Windows.Controls.ListViewItem.AllowDropProperty,
                           True))

        item_cstyle.Setters.Add(
            Windows.EventSetter(
                Windows.Controls.ListViewItem.PreviewMouseLeftButtonDownEvent,
                Windows.Input.MouseButtonEventHandler(
                    self.preview_mouse_down)))

        item_cstyle.Setters.Add(
            Windows.EventSetter(Windows.Controls.ListViewItem.DropEvent,
                                Windows.DragEventHandler(self.drop_sheet)))