From 82db3f1027801f7652bb2032830d489ece05cf46 Mon Sep 17 00:00:00 2001 From: thumDer <54556708+thumDer@users.noreply.github.com> Date: Sat, 21 Nov 2020 19:22:59 +0100 Subject: [PATCH] Sorting parameters by name in selector forms (#1060) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 Co-authored-by: Tamás Déri --- pyrevitlib/pyrevit/forms/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyrevitlib/pyrevit/forms/__init__.py b/pyrevitlib/pyrevit/forms/__init__.py index 97bb66142..ec06fbb7e 100644 --- a/pyrevitlib/pyrevit/forms/__init__.py +++ b/pyrevitlib/pyrevit/forms/__init__.py @@ -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") @@ -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") )