예제 #1
0
파일: script.py 프로젝트: ShaperGZ/pyRevit
    def _setup_addinfiles(self):
        """Reads the state of pyRevit addin files for different Revit versions
        and updates the ui.
        """

        self.is_pyrevit_allusers = addinfiles.is_pyrevit_for_allusers()
        if self.is_pyrevit_allusers:
            addinfiles_states = addinfiles.get_addinfiles_state(allusers=True)
            self.revitversions_tb.Text = \
                str(self.revitversions_tb.Text).replace('%appdata%',
                                                        '%programdata%')
        else:
            addinfiles_states = addinfiles.get_addinfiles_state()

        for rvt_ver, checkbox in self._addinfiles_cboxes.items():
            if rvt_ver in addinfiles_states.keys():
                if rvt_ver != HOST_APP.version:
                    checkbox.IsEnabled = True
                    checkbox.IsChecked = addinfiles_states[rvt_ver]
                else:
                    checkbox.Content = 'Revit {} (Current version. ' \
                                       'Can not disable.)'.format(rvt_ver)
                    checkbox.IsEnabled = False
                    checkbox.IsChecked = True
            else:
                checkbox.Content = 'Revit {} (Not installed)'.format(rvt_ver)
                checkbox.IsChecked = checkbox.IsEnabled = False
예제 #2
0
파일: script.py 프로젝트: kjanik11/pyRevit
    def _setup_addinfiles(self):
        addinfiles_states = get_addinfiles_state()

        for rvt_ver, checkbox in self._addinfiles_checkboxes.items():
            if rvt_ver in addinfiles_states.keys():
                if rvt_ver != HOST_APP.version:
                    checkbox.IsEnabled = True
                    checkbox.IsChecked = addinfiles_states[rvt_ver]
                else:
                    checkbox.Content = 'Revit {} (Current version. Can not disable.)'.format(rvt_ver)
                    checkbox.IsEnabled = False
                    checkbox.IsChecked = True
            else:
                checkbox.Content = 'Revit {} (Not installed)'.format(rvt_ver)
                checkbox.IsChecked = checkbox.IsEnabled = False