示例#1
0
    def save_options(self, sender, args):
        errors = []
        try:
            my_config.exceptions = pau.str2list(self.exceptions.Text)
        except:
            errors.append("Exceptions value is invalid")

        try:
            v = self.material.Text
            assert len(v) >= 0
            my_config.material = v
        except:
            errors.append("Material name is invalid")

        try:
            my_config.ignore_transparent = bool(self.ignore_transparent.IsChecked)
        except:
            errors.append("Ignore transparent value is invalid")

        if errors:
            alert("Can't save config.\n" + "\n".join(errors))
            return
        else:
            script.save_config()
            self.Close()
示例#2
0
    def save_config(self):
        # save self.window_geom
        new_window_geom_dict = {}
        # cleanup removed keynote files
        for kfile, wgeom_value in self._config.get_option(
                'last_window_geom', {}).items():
            if op.exists(kfile):
                new_window_geom_dict[kfile] = wgeom_value
        new_window_geom_dict[self._kfile] = self.window_geom
        self._config.set_option('last_window_geom', new_window_geom_dict)

        # save self.postable_keynote_command
        new_postcmd_dict = {}
        # cleanup removed keynote files
        for kfile, lpc_value in self._config.get_option(
                'last_postcmd_idx', {}).items():
            if op.exists(kfile):
                new_postcmd_dict[kfile] = lpc_value
        new_postcmd_dict[self._kfile] = self.postcmd_idx
        self._config.set_option('last_postcmd_idx', new_postcmd_dict)

        # save self.selected_category
        new_category_dict = {}
        # cleanup removed keynote files
        for kfile, lc_value in self._config.get_option('last_category',
                                                       {}).items():
            if op.exists(kfile):
                new_category_dict[kfile] = lc_value
        new_category_dict[self._kfile] = ''
        if self.selected_category:
            new_category_dict[self._kfile] = self.selected_category.key
        self._config.set_option('last_category', new_category_dict)
        script.save_config()
示例#3
0
    def save_options(self, sender, args):
        self._config.halftone = self.halftone.IsChecked
        self._config.transparency = self.transparency.IsChecked
        self._config.proj_line_color = self.proj_line_color.IsChecked
        self._config.proj_line_pattern = self.proj_line_pattern.IsChecked
        self._config.proj_line_weight = self.proj_line_weight.IsChecked
        self._config.proj_fill_color = self.proj_fill_color.IsChecked
        self._config.proj_fill_pattern = self.proj_fill_pattern.IsChecked
        self._config.proj_fill_pattern_visibility = \
            self.proj_fill_pattern_visibility.IsChecked
        self._config.cut_line_color = self.cut_line_color.IsChecked
        self._config.cut_line_pattern = self.cut_line_pattern.IsChecked
        self._config.cut_line_weight = self.cut_line_weight.IsChecked
        self._config.cut_fill_color = self.cut_fill_color.IsChecked
        self._config.cut_fill_pattern = self.cut_fill_pattern.IsChecked
        self._config.cut_fill_pattern_visibility = \
            self.cut_fill_pattern_visibility.IsChecked

        self._config.dim_override = self.dim_override.IsChecked
        self._config.dim_textposition = self.dim_textposition.IsChecked
        self._config.dim_above = self.dim_above.IsChecked
        self._config.dim_below = self.dim_below.IsChecked
        self._config.dim_prefix = self.dim_prefix.IsChecked
        self._config.dim_suffix = self.dim_suffix.IsChecked

        script.save_config()
        self.Close()
示例#4
0
 def set_naming_formats(naming_formats):
     naming_formats_dict = {
         x.name: x.template
         for x in naming_formats if not x.builtin
     }
     config.namingformats = naming_formats_dict
     script.save_config()
示例#5
0
 def save_options(self, sender, e):
     self._config.prefix = self.tbox_prefix.Text
     self._config.depth_offset = export_config_length(self.tbox_depth_offset.Text)
     self._config.height_offset = export_config_length(self.tbox_height_offset.Text)
     self._config.width_offset = export_config_length(self.tbox_width_offset.Text)
     script.save_config()
     self.Close()
示例#6
0
 def write_config(self):
     my_config.text_format = self.textFormat.Text
     my_config.leading_zeros = self.leadingZeros.Text
     my_config.parameter_to_sort = self.parameterToSort.Text
     my_config.parameter_to_set = self.parameterToSet.Text
     my_config.is_reversed = self.isReversed.IsChecked
     script.save_config()
示例#7
0
 def save_options(self, sender, e):
     self._config.prefix = self.tbox_prefix.Text
     self._config.X_Right = export_config_length(self.tbox_X_Right.Text)
     self._config.X_Left = export_config_length(self.tbox_X_Left.Text)
     self._config.Y_Up = export_config_length(self.tbox_Y_Up.Text)
     self._config.Y_Bottom = export_config_length(self.tbox_Y_Bottom.Text)
     script.save_config()
     self.Close()
示例#8
0
    def __init__(self, xaml_file_name):
        forms.WPFWindow.__init__(self, xaml_file_name)

        self._config = script.get_config()

        self.rundialog.IsChecked = \
            self._config.get_option('dialog', default_value=True)

        script.save_config()
示例#9
0
    def __init__(self, xaml_file_name):
        forms.WPFWindow.__init__(self, xaml_file_name)

        self._config = script.get_config()

        self.proc_alpha.IsChecked = \
            self._config.get_option('process_alpha', default_value=True)

        script.save_config()
示例#10
0
    def save_options(self, sender, args):
        # base
        self._config.halftone = self.halftone.IsChecked
        self._config.transparency = self.transparency.IsChecked

        # projection lines
        self._config.proj_line_color = self.proj_line_color.IsChecked
        self._config.proj_line_pattern = self.proj_line_pattern.IsChecked
        self._config.proj_line_weight = self.proj_line_weight.IsChecked

        # projection forground pattern
        self._config.proj_fill_color = self.proj_fill_color.IsChecked
        self._config.proj_fill_pattern = self.proj_fill_pattern.IsChecked
        self._config.proj_fill_pattern_visibility = \
            self.proj_fill_pattern_visibility.IsChecked

        # projection background pattern (Revit >= 2019)
        if HOST_APP.is_newer_than(2019, or_equal=True):
            self._config.proj_bg_fill_color = \
                self.proj_bg_fill_color.IsChecked
            self._config.proj_bg_fill_pattern = \
                self.proj_bg_fill_pattern.IsChecked
            self._config.proj_bg_fill_pattern_visibility = \
                self.proj_bg_fill_pattern_visibility.IsChecked

        # cut lines
        self._config.cut_line_color = self.cut_line_color.IsChecked
        self._config.cut_line_pattern = self.cut_line_pattern.IsChecked
        self._config.cut_line_weight = self.cut_line_weight.IsChecked

        # cut forground pattern
        self._config.cut_fill_color = self.cut_fill_color.IsChecked
        self._config.cut_fill_pattern = self.cut_fill_pattern.IsChecked
        self._config.cut_fill_pattern_visibility = \
            self.cut_fill_pattern_visibility.IsChecked

        # cut background pattern (Revit >= 2019)
        if HOST_APP.is_newer_than(2019, or_equal=True):
            self._config.cut_bg_fill_color = \
                self.cut_bg_fill_color.IsChecked
            self._config.cut_bg_fill_pattern = \
                self.cut_bg_fill_pattern.IsChecked
            self._config.cut_bg_fill_pattern_visibility = \
                self.cut_bg_fill_pattern_visibility.IsChecked

        # dim overrides
        self._config.dim_override = self.dim_override.IsChecked
        self._config.dim_textposition = self.dim_textposition.IsChecked
        self._config.dim_above = self.dim_above.IsChecked
        self._config.dim_below = self.dim_below.IsChecked
        self._config.dim_prefix = self.dim_prefix.IsChecked
        self._config.dim_suffix = self.dim_suffix.IsChecked

        script.save_config()
        self.Close()
示例#11
0
def config_ignore_selected():
    try:
        v = my_config.ignore_selected
    except:
        import show_dependent_defaults as cdef
        v = cdef.ignore_selected

        my_config.ignore_selected = v
        script.save_config()

    return v
示例#12
0
def config_exceptions():
    try:
        v = my_config.exceptions
    except:
        import show_dependent_defaults as cdef
        v = cdef.exceptions

        my_config.exceptions = v
        script.save_config()

    return v
示例#13
0
def config_limit():
    try:
        v = my_config.limit
    except:
        import show_dependent_defaults as cdef
        v = cdef.limit

        my_config.limit = v
        script.save_config()

    return v
示例#14
0
 def save_config_click(self, sender, e):
     logger.debug('Start writing config file')
     for view_class in self.view_class_dict.keys():
         view_class_checkbox = eval('self.cb_{}'.format(view_class))
         logger.debug(view_class_checkbox.IsChecked)
         if view_class_checkbox.IsChecked:
             pattern_textbox = eval('self.{}_pattern'.format(view_class))
             logger.debug(type(pattern_textbox.Text))
             setattr(my_config, view_class,
                     pattern_textbox.Text.encode('utf8'))
     script.save_config()
     logger.debug('End writing config file')
示例#15
0
def config_temp_dir():
    try:
        v = my_config.temp_dir
    except:
        import purge_families_defaults as cdef
        v = cdef.temp_dir

        my_config.temp_dir = v
        script.save_config()
    if isinstance(v, list):
        v = v[0]
    return v
示例#16
0
    def save_options(self, sender, args):
        self._config.process_links = self.proc_links.IsChecked
        self._config.process_placeholders = self.proc_placeholders.IsChecked
        self._config.process_sheetdisc = self.proc_sheetdisc.IsChecked
        self._config.sheetdisc_param = self.sheetdiscparam_tb.Text
        self._config.prefix_numchars = str(self.prefix_numchars_tb.Text)
        self._config.exportfolder = self.exportfolder_tb.Text
        self._config.sheetfilter = self.sheetvolumefilter_tb.Text
        self._config.sheetfilter_param = self.sheetvolumefilterparam_tb.Text
        self._config.filter_include = self.filtertype_include_b.IsChecked
        self._config.filter_exclude = self.filtertype_exclude_b.IsChecked

        script.save_config()
        self.Close()
示例#17
0
    def read_config(self):
        # check are last parameters available
        try:
            if my_config.parameter_to_sort not in self.parameters_sortable:
                my_config.parameter_to_sort = ""
        except:
            pass
        try:
            if my_config.parameter_to_set not in self.parameters_editable:
                my_config.parameter_to_set = ""
        except:
            pass

        try:
            self.textFormat.Text = str(my_config.text_format)
        except:
            self.textFormat.Text = my_config.text_format = "%s"

        try:
            self.leadingZeros.Text = str(my_config.leading_zeros)
        except:
            self.leadingZeros.Text = my_config.leading_zeros = "0"

        try:
            self.startFrom.Text = str(my_config.start_from)
        except:
            self.startFrom.Text = my_config.start_from = "1"

        try:
            self.parameterToSort.Text = str(my_config.parameter_to_sort)
        except:
            self.parameterToSort.Text = my_config.parameter_to_sort = ""

        try:
            self.parameterToSort.Text = str(my_config.parameter_to_sort)
        except:
            self.parameterToSort.Text = my_config.parameter_to_sort = ""

        try:
            self.parameterToSet.Text = str(my_config.parameter_to_set)
        except:
            self.parameterToSet.Text = my_config.parameter_to_set = ""

        try:
            self.isReversed.IsChecked = my_config.is_reversed
        except:
            self.isReversed.IsChecked = my_config.is_reversed = False

        script.save_config()
示例#18
0
    def __init__(self, xaml_file_name):
        forms.WPFWindow.__init__(self, xaml_file_name)

        self._config = script.get_config()

        self.halftone.IsChecked = \
            self._config.get_option('halftone', True)
        self.transparency.IsChecked = \
            self._config.get_option('transparency', True)
        self.proj_line_color.IsChecked = \
            self._config.get_option('proj_line_color', True)
        self.proj_line_pattern.IsChecked = \
            self._config.get_option('proj_line_pattern', True)
        self.proj_line_weight.IsChecked = \
            self._config.get_option('proj_line_weight', True)
        self.proj_fill_color.IsChecked = \
            self._config.get_option('proj_fill_color', True)
        self.proj_fill_pattern.IsChecked = \
            self._config.get_option('proj_fill_pattern', True)
        self.proj_fill_pattern_visibility.IsChecked = \
            self._config.get_option('proj_fill_pattern_visibility', True)
        self.cut_line_color.IsChecked = \
            self._config.get_option('cut_line_color', True)
        self.cut_line_pattern.IsChecked = \
            self._config.get_option('cut_line_pattern', True)
        self.cut_line_weight.IsChecked = \
            self._config.get_option('cut_line_weight', True)
        self.cut_fill_color.IsChecked = \
            self._config.get_option('cut_fill_color', True)
        self.cut_fill_pattern.IsChecked = \
            self._config.get_option('cut_fill_pattern', True)
        self.cut_fill_pattern_visibility.IsChecked = \
            self._config.get_option('cut_fill_pattern_visibility', True)

        self.dim_override.IsChecked = \
            self._config.get_option('dim_override', True)
        self.dim_textposition.IsChecked = \
            self._config.get_option('dim_textposition', False)
        self.dim_above.IsChecked = self._config.get_option('dim_above', True)
        self.dim_below.IsChecked = self._config.get_option('dim_below', True)
        self.dim_prefix.IsChecked = self._config.get_option('dim_prefix', True)
        self.dim_suffix.IsChecked = self._config.get_option('dim_suffix', True)

        script.save_config()
示例#19
0
    def __init__(self, xaml_file_name):
        forms.WPFWindow.__init__(self, xaml_file_name)

        self._config = script.get_config()

        self.proc_links.IsChecked = \
            self._config.get_option('process_links', default_value=True)

        self.proc_placeholders.IsChecked = \
            self._config.get_option('process_placeholders', default_value=True)

        self.prefix_numchars_tb.Text = \
            str(self._config.get_option('prefix_numchars', default_value='2'))

        self.sheetdiscparam_tb.Text = \
            self._config.get_option('sheetdisc_param', default_value='Sheet Discipline Number')

        self.proc_sheetdisc.IsChecked = \
            self._config.get_option('process_sheetdisc', default_value=True)

        self.sheetvolumefilterparam_tb.Text = \
            self._config.get_option('sheetfilter_param', default_value='Volume Number')

        self.sheetvolumefilter_tb.Text = \
            self._config.get_option('sheetfilter', default_value='')

        self.exportfolder_tb.Text = \
            self._config.get_option('exportfolder',
                                                default_value='Export_dynamo')

        self.filtertype_include_b.IsChecked = \
            self._config.get_option('filter_include',
                                                default_value=True)

        self.filtertype_exclude_b.IsChecked = \
            self._config.get_option('filter_exclude',
                                                default_value=False)

        self.proc_manual.IsChecked = \
            self._config.get_option('process_man', default_value=True)

        script.save_config()
示例#20
0
    def save_options(self, sender, args):
        errors = []
        directory = self.temp_dir.Text
        try:
            if not os.path.exists(directory):
                os.makedirs(directory)

            if not os.path.isdir(directory):
                errors.append("Specified path is not a directory")
            if len(errors) == 0:
                my_config.temp_dir = pau.str2list(self.temp_dir.Text)
        except Exception as e:
            errors.append("Specified path is invalid.\n%s" % str(e))

        if errors:
            alert("Can't save config.\n" + "\n".join(errors))
            return
        else:
            script.save_config()
            self.Close()
示例#21
0
    def save_options(self, sender, args):
        errors = []
        try:
            my_config.exceptions = pau.str2list(self.exceptions.Text)
        except:
            errors.append("Exceptions value is invalid")

        try:
            v = int(self.limit.Text)
            assert v >= 0
            my_config.limit = v
        except:
            errors.append(
                "Limit value should be either zero or a positive integer")

        if errors:
            alert("Can't save config.\n" + "\n".join(errors))
            return
        else:
            script.save_config()
            self.Close()
示例#22
0
def save_config(cats):
    custom_config.chosen_categories = [x.Name for x in cats]
    script.save_config()
示例#23
0
    def __init__(self, xaml_file_name):
        forms.WPFWindow.__init__(self, xaml_file_name)

        self._config = script.get_config()

        # base
        self.halftone.IsChecked = \
            self._config.get_option('halftone', True)
        self.transparency.IsChecked = \
            self._config.get_option('transparency', True)

        # projection lines
        self.proj_line_color.IsChecked = \
            self._config.get_option('proj_line_color', True)
        self.proj_line_pattern.IsChecked = \
            self._config.get_option('proj_line_pattern', True)
        self.proj_line_weight.IsChecked = \
            self._config.get_option('proj_line_weight', True)

        # projection forground pattern
        self.proj_fill_color.IsChecked = \
            self._config.get_option('proj_fill_color', True)
        self.proj_fill_pattern.IsChecked = \
            self._config.get_option('proj_fill_pattern', True)
        self.proj_fill_pattern_visibility.IsChecked = \
            self._config.get_option('proj_fill_pattern_visibility', True)

        # projection background pattern (Revit >= 2019)
        if HOST_APP.is_newer_than(2019, or_equal=True):
            self.proj_bg_fill_color.IsChecked = \
                self._config.get_option('proj_bg_fill_color', True)
            self.proj_bg_fill_pattern.IsChecked = \
                self._config.get_option('proj_bg_fill_pattern', True)
            self.proj_bg_fill_pattern_visibility.IsChecked = \
                self._config.get_option('proj_bg_fill_pattern_visibility', True)

        # cut lines
        self.cut_line_color.IsChecked = \
            self._config.get_option('cut_line_color', True)
        self.cut_line_pattern.IsChecked = \
            self._config.get_option('cut_line_pattern', True)
        self.cut_line_weight.IsChecked = \
            self._config.get_option('cut_line_weight', True)

        # cut forground pattern
        self.cut_fill_color.IsChecked = \
            self._config.get_option('cut_fill_color', True)
        self.cut_fill_pattern.IsChecked = \
            self._config.get_option('cut_fill_pattern', True)
        self.cut_fill_pattern_visibility.IsChecked = \
            self._config.get_option('cut_fill_pattern_visibility', True)

        # cut background pattern (Revit >= 2019)
        if HOST_APP.is_newer_than(2019, or_equal=True):
            self.cut_bg_fill_color.IsChecked = \
                self._config.get_option('cut_bg_fill_color', True)
            self.cut_bg_fill_pattern.IsChecked = \
                self._config.get_option('cut_bg_fill_pattern', True)
            self.cut_bg_fill_pattern_visibility.IsChecked = \
                self._config.get_option('cut_bg_fill_pattern_visibility', True)

        # dim overrides
        self.dim_override.IsChecked = \
            self._config.get_option('dim_override', True)
        self.dim_textposition.IsChecked = \
            self._config.get_option('dim_textposition', False)
        self.dim_above.IsChecked = self._config.get_option('dim_above', True)
        self.dim_below.IsChecked = self._config.get_option('dim_below', True)
        self.dim_prefix.IsChecked = self._config.get_option('dim_prefix', True)
        self.dim_suffix.IsChecked = self._config.get_option('dim_suffix', True)

        script.save_config()
示例#24
0
def save_configs(categories):
    """Save given list of categories as frequently selected"""
    my_config.fscats = [x.Name for x in categories]
    script.save_config()
示例#25
0
def save_config(res):
    custom_config.chosen_method = res
    script.save_config()
示例#26
0
 def write_config(self):
     my_config.parameter_to_get = self.parameterToGet.Text.encode('utf-8')
     my_config.parameter_to_set = self.parameterToSet.Text.encode('utf-8')
     my_config.operation = self.operation.Text.encode('utf-8')
     my_config.reset_to_zero = self.resetToZero.IsChecked
     script.save_config()
示例#27
0
    def save_options(self, sender, args):
        self._config.dialog = self.rundialog.IsChecked

        script.save_config()
        self.Close()
示例#28
0
 def write_config(self):
     my_config.parameter_to_get = self.parameterToGet.Text
     my_config.parameter_to_set = self.parameterToSet.Text
     script.save_config()
示例#29
0
#from Tkinter import *
#from tkColorChooser import askcolor
"""class getColor():
    def __init__(self):
        #color = askcolor()[0]
        color = forms.select_swatch.show(title="Select alternate background color")

        self._config = script.get_config()

        self.selected_color = self._config.get_option('selected_color', default_value=(255,255,255))

        script.save_config()

    def cancel(self, sender, args):

        self.Close()

    def save_options(self, sender, args):
        self._config.selected_color = color

        script.save_config()
        self.Close()
"""
color = forms.select_swatch(title="Select alternate background color")

if not (color is None):
    #print(color)
    _config = script.get_config()
    _config.selected_color = str(color)
    script.save_config()
示例#30
0
def set_minifyui_config(hidden_tabs_list, config):
    config.hidden_tabs = hidden_tabs_list
    script.save_config()