Skip to content

Commit

Permalink
Sorting parameters by name in selector forms (#1060)
Browse files Browse the repository at this point in the history
* fixed host adder and added 2020.2.3

* added 2020.1.1 to hosts

* added sort function

* sort family parameters

Co-authored-by: Ehsan Iran-Nejad <eirannejad@gmail.com>
Co-authored-by: Tamás Déri <tamas.deri@in-ex.hu>
  • Loading branch information
3 people authored Nov 21, 2020
1 parent 88a311f commit 82db3f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyrevitlib/pyrevit/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2236,6 +2236,8 @@ def select_parameters(src_element,

if filterfunc:
param_defs = filter(filterfunc, param_defs)

param_defs.sort(key=lambda x: x.name)

itemplate = utils.load_ctrl_template(
os.path.join(XAML_FILES_DIR, "ParameterItemStyle.xaml")
Expand Down Expand Up @@ -2315,6 +2317,8 @@ def select_family_parameters(family_doc,
labeled=family_param.Id in label_param_ids)
)

param_defs.sort(key=lambda x: x.name)

itemplate = utils.load_ctrl_template(
os.path.join(XAML_FILES_DIR, "FamilyParameterItemStyle.xaml")
)
Expand Down

0 comments on commit 82db3f1

Please sign in to comment.