Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiselect from different groups returns only selections from one group #2286

Open
5 tasks done
Reese-Weingaertner opened this issue Jun 18, 2024 · 4 comments
Open
5 tasks done
Labels
Enhancement Enhancement request [class->Improved #{number}: {title}] Tools Issues related to pyRevit commands [subsystem]

Comments

@Reese-Weingaertner
Copy link

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

Unsure if this is a bug or intended -- so apologies if this is in the wrong place. I think it could be improved regardless.

When using forms.SelectFromList with a dict(, ) input and setting multiselect=True, the user can make multiple selections from different groups, but only items in the group currently open when clicking the button will be output.

⌨ Error/Debug Message

Behavior is unexpected but no error / exception is raised.

♻️ To Reproduce

pseudocode to reproduce:

categories = { "one", ['a', 'b', 'c'], "two", ['d', 'e', 'f']}
selected = forms.SelectFromList.show(categories, multiselect=True)
--- running code : user checks 'a' from "one", changes categories and selects 'd' from "two", then submits
output: selected = ['d'] # selection of 'a' is missing, even though it was checked when form was closed

⏲️ Expected behavior

The expected behavior from the above example would be to return ['a', 'd']

🖥️ Hardware and Software Setup (please complete the following information)

==> Registered Clones (full git repos)                                                                                  ==> Registered Clones (deployed from archive/image)                                                                     master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.16.24121+2117" | Path: "C:\Users\Cathy\AppData\Roaming\pyRevit-Master"                                                                                                         ==> Attachments                                                                                                         master | Product: "Autodesk Revit 2021" | Engine: DEFAULT (2711) | Path: "C:\Users\Cathy\AppData\Roaming\pyRevit-Master"                                                                                                                        ==> Installed Extensions                                                                                                EF-Tools | Type: UIExtension | Repo: "https://github.com/ErikFrits/EF-Tools.git" | Installed: "C:\Users\Cathy\Documents\RevitTools\EF-Tools.extension"                                                                                          GuideTools | Type: Unknown | Repo: "" | Installed: "C:\Users\Cathy\Documents\RevitTools\GUIDE-Tools\GuideTools.extension"                                                                                                                       GuideTools | Type: Unknown | Repo: "" | Installed: "C:\Users\Cathy\Documents\RevitTools\GuideTools.extension"           ==> Default Extension Search Path                                                                                       C:\Users\Cathy\AppData\Roaming\pyRevit\Extensions                                                                       ==> Extension Search Paths                                                                                              C:\Users\Cathy\Documents\RevitTools\GUIDE-Tools                                                                         C:\Users\Cathy\Documents\RevitTools                                                                                     ==> Extension Sources - Default                                                                                         https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json                                            ==> Extension Sources - Additional                                                                                      ==> Installed Revits                                                                                                    Autodesk Revit 2021 | Version: 21.1.21.45 | Build: 20201116_1100(x64) | Language: 1033 | Path: "D:\Program Files\Autodesk\Revit 2021\"                                                                                                          ==> Running Revit Instances                                                                                             Error: Object reference not set to an instance of an object.                                                            Run with "--debug" option to see debug messages

Additional context

No response

@Reese-Weingaertner Reese-Weingaertner added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Jun 18, 2024
@jmcouffin jmcouffin added Enhancement Enhancement request [class->Improved #{number}: {title}] Tools Issues related to pyRevit commands [subsystem] and removed Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] labels Jun 19, 2024
@Reese-Weingaertner Reese-Weingaertner changed the title [Bug]: Multiselect from different groups returns only selections from one group Multiselect from different groups returns only selections from one group Jun 19, 2024
@Reese-Weingaertner
Copy link
Author

If anyone can point me to where to start looking, I'd be happy to work on the change myself.

@sanzoghenzo
Copy link
Contributor

Hi @Reese-Weingaertner, thanks for reporting the issue.

I believe this is the intended original behavior, so if you want to modify it, I propose to handle it via an option like results_from_all_group that defaults to False, so that we keep retrocompatibility.

The method that returns the selected object is this:

def _get_options(self):

@Reese-Weingaertner
Copy link
Author

Sounds like a good idea @sanzoghenzo, thanks for your help. I'll start working on this.

@onomou
Copy link
Contributor

onomou commented Oct 7, 2024

See related discussion here: SelectFromList return_all not returning all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhancement request [class->Improved #{number}: {title}] Tools Issues related to pyRevit commands [subsystem]
Projects
None yet
Development

No branches or pull requests

4 participants