pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.33k stars 338 forks source link

Multi Group List fails #1071

Closed thumDer closed 4 years ago

thumDer commented 4 years ago

Describe the bug forms.SelectFromList fails with the following exception:

Traceback (most recent call last):
 File "C:\_stuffz\pyRevit\Extensions\pyNexTools.extension\pyNex.tab\Views.panel\PlansPerLevel.pushbutton\PlansPerLevel_script.py", line 60, in <module>
 File "C:\pyRevit\main\pyrevitlib\pyrevit\forms\__init__.py", line 609, in _setup
 File "C:\pyRevit\main\pyrevitlib\pyrevit\forms\__init__.py", line 655, in _update_ctx_groups
 File "C:\pyRevit\main\pyrevitlib\pyrevit\forms\__init__.py", line 765, in search_txt_changed
 File "C:\pyRevit\main\pyrevitlib\pyrevit\forms\__init__.py", line 399, in show
 File "C:\pyRevit\main\pyrevitlib\pyrevit\forms\__init__.py", line 379, in __init__
 File "C:\pyRevit\main\pyrevitlib\pyrevit\forms\__init__.py", line 639, in _prepare_context
 File "C:\pyRevit\main\pyrevitlib\pyrevit\forms\__init__.py", line 691, in _list_options
TypeError: Error in IEnumeratorOfTWrapper.Current. Could not cast: IronPython.NewTypes.System.Object#INotifyPropertyChanged_28$29 in System.String

To Reproduce Just call the show function of SelectFromList in any script with a Dict as the context instead of a List to have a multi group list (as per https://www.notion.so/Effective-Input-ea95e95282a24ba9b154ef88f4f8d056)

Expected behavior A nice multi group list shows up.

Desktop (please complete the following information):

==> User Environment
Microsoft Windows 10 [Version 10.0.19041]
Executing User: IN-EX\tamas.deri
Active User:
Admin Access: No
%APPDATA%: "C:\Users\tamas.deri\AppData\Roaming"
Latest Installed .Net Framework: 4.8
Installed .Net Target Packs: v3.5 v4.0 v4.5 v4.5.1 v4.5.2 v4.6 v4.6.1 v4.7 v4.7.1 v4.7.2 v4.X
Installed .Net-Core Target Packs: v3.1.401
pyRevit CLI 4.8.2.0
==> Registered Clones (full git repos)
dev | Branch: "develop" | Version: "4.8.2:6fa0404" | Path: "C:\pyRevit\git\dev"
==> Registered Clones (deployed from archive/image)
main | Deploy: "base" | Branch: "master" | Version: "4.8.2" | Path: "C:\pyRevit\main"
==> Attachments
main | Product: "2021 First Customer Ship" | Engine: 277 | Path: "C:\pyRevit\main" | Manifest: "C:\ProgramData\Autodesk\Revit\Addins\2021\pyRevit.addin"
main | Product: "2020.2.2 (Full Install)" | Engine: 277 | Path: "C:\pyRevit\main" | Manifest: "C:\ProgramData\Autodesk\Revit\Addins\2020\pyRevit.addin"
main | Product: "2019.2.1" | Engine: 277 | Path: "C:\pyRevit\main" | Manifest: "C:\ProgramData\Autodesk\Revit\Addins\2019\pyRevit.addin"
main | Product: "2018.3.3 Security Fix" | Engine: 277 | Path: "C:\pyRevit\main" | Manifest: "C:\ProgramData\Autodesk\Revit\Addins\2018\pyRevit.addin"
eirannejad commented 4 years ago

What object types are included in the dict?!

thumDer commented 4 years ago

I've tried with ViewPlan, string, even with the default example dict from notion. The same form works fine with a ViewPlan list.

eirannejad commented 4 years ago

Fixed and will be published with next release

thumDer commented 4 years ago

Thanks! :)