From 908914f00a960cdbbd59ace497d9875fee5ba203 Mon Sep 17 00:00:00 2001 From: 3Pinter <40979006+3Pinter@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:27:29 +0100 Subject: [PATCH 1/3] Update __init__.py added Line 2685 if src_type is not None scr_type can be None if no type is present. (Parts don't have Type for instance which will break the code.) --- pyrevitlib/pyrevit/forms/__init__.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pyrevitlib/pyrevit/forms/__init__.py b/pyrevitlib/pyrevit/forms/__init__.py index fdf433ced..131af2e66 100644 --- a/pyrevitlib/pyrevit/forms/__init__.py +++ b/pyrevitlib/pyrevit/forms/__init__.py @@ -2670,7 +2670,7 @@ def select_parameters(src_element, param_defs = [] non_storage_type = coreutils.get_enum_none(DB.StorageType) if include_instance: - # collect instance parameters + # collect instance parameters param_defs.extend( [ParamDef(name=x.Definition.Name, istype=False, @@ -2681,16 +2681,17 @@ def select_parameters(src_element, ) if include_type: - # collect type parameters - src_type = revit.query.get_type(src_element) - param_defs.extend( - [ParamDef(name=x.Definition.Name, - istype=True, - definition=x.Definition, - isreadonly=x.IsReadOnly) - for x in src_type.Parameters - if x.StorageType != non_storage_type] - ) + # collect type parameters + if src_type is not None: + src_type = revit.query.get_type(src_element) + param_defs.extend( + [ParamDef(name=x.Definition.Name, + istype=True, + definition=x.Definition, + isreadonly=x.IsReadOnly) + for x in src_type.Parameters + if x.StorageType != non_storage_type] + ) if exclude_readonly: param_defs = filter(lambda x: not x.isreadonly, param_defs) From 1f9d4eedd799c907ab1f649dd5a85f5310a7cac9 Mon Sep 17 00:00:00 2001 From: Jean-Marc Couffin Date: Mon, 4 Mar 2024 17:03:51 +0100 Subject: [PATCH 2/3] Update __init__.py --- pyrevitlib/pyrevit/forms/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrevitlib/pyrevit/forms/__init__.py b/pyrevitlib/pyrevit/forms/__init__.py index 131af2e66..a321a42b4 100644 --- a/pyrevitlib/pyrevit/forms/__init__.py +++ b/pyrevitlib/pyrevit/forms/__init__.py @@ -2681,7 +2681,7 @@ def select_parameters(src_element, ) if include_type: - # collect type parameters + # collect type parameters if src_type is not None: src_type = revit.query.get_type(src_element) param_defs.extend( From 2ba839907f617626ae245317c437821eb20eb82c Mon Sep 17 00:00:00 2001 From: Jean-Marc Couffin Date: Mon, 4 Mar 2024 17:04:32 +0100 Subject: [PATCH 3/3] Update __init__.py --- pyrevitlib/pyrevit/forms/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrevitlib/pyrevit/forms/__init__.py b/pyrevitlib/pyrevit/forms/__init__.py index a321a42b4..c74db9d95 100644 --- a/pyrevitlib/pyrevit/forms/__init__.py +++ b/pyrevitlib/pyrevit/forms/__init__.py @@ -2670,7 +2670,7 @@ def select_parameters(src_element, param_defs = [] non_storage_type = coreutils.get_enum_none(DB.StorageType) if include_instance: - # collect instance parameters + # collect instance parameters param_defs.extend( [ParamDef(name=x.Definition.Name, istype=False,