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

[Bug]: Cannot create single stack from multiple extensions #2445

Open
5 tasks done
alexdaversa opened this issue Oct 30, 2024 · 0 comments
Open
5 tasks done

[Bug]: Cannot create single stack from multiple extensions #2445

alexdaversa opened this issue Oct 30, 2024 · 0 comments
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] New Feature New feature request [class->Implemented #{number}: {title}]

Comments

@alexdaversa
Copy link
Contributor

alexdaversa commented Oct 30, 2024

✈ 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

I am finally getting around to adding an autosave extension after promising to do so quite some time ago (apologies but my project work increased significantly for the past 10 months).

I am attempting to add a smartbutton to enable/disable the feature to the existing Toggles section of the main pyRevit toolbar to save space within the toolbar and not create another toolbar for one button. Attempting to do so results in a separate full size button adjacent to the stack.

The script is saved in this folder, for reference: pyRevitAutosave.extension\pyRevit.tab\Toggles.panel\toggles3.stack\Autosave.smartbutton

I have not previously dug into the loader or UI builder portions of the code (mostly just the tools and hooks) but it seems like this goes through coreutils/ribbon.py line 1226 which finds one stack item in the autosave extension folder and creates a full size button out of the stack, then later separately loads the tools extension, and finds two buttons in the toggles3 folder and creates a stack from those.

Editing ribbon.py to allow stack creation with data_obj_count == 1 as well as 2 and 3, and commenting out lines 1249-1252 seems to include the autosave function in the first stack, which then breaks as it then has 4 items, per line 1259.

Renaming the extension to pyRevitzAutosave to load it last (as I expect the extension traversal is alphabetical) results in the error:
ERROR [pyrevit.loader.uimaker] Can not create stack under this parent: Name: Toggles RevitAPIObject: <Autodesk.Revit.UI.RibbonPanel object at 0x0000000000000498 [Autodesk.Revit.UI.RibbonPanel]> | AddStackedItems() takes at least 2 arguments (1 given) which removes the toggles panel completely.

⌨ Error/Debug Message

The "fix" for this would likely involve a significant refactoring of the loader/uimaker to analyze each extension and combine common subpaths before creating ui elements. Alternately (or in conjunction), stacks could be created from one folder with more than 3 items in a way that overflows into another adjacent stack.

♻️ To Reproduce

No response

⏲️ Expected behavior

It would be nice for extensions to be able to share the same stack.

🖥️ 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:\Program Files\pyRevit-Master"
==> Attachments
master | Product: "24.2.1" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "23.1.4" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2022.1.5" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2020.2.9" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2019.2.6" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2018.3.3 Security Fix" | Engine: DEFAULT (2711) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
==> Installed Extensions
==> Default Extension Search Path
C:\Users\adaversa\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
24.2.1 | Version: 24.2.10.64 | Build: 20240408_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
23.1.4 | Version: 23.1.40.56 | Build: 20240411_0945(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2023\"
2022.1.5 | Version: 22.1.50.17 | Build: 20230915_1530(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
2020.2.9 | Version: 20.2.90.12 | Build: 20220517_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2020\"
2019.2.6 | Version: 19.2.60.3 | Build: 20220224_1700(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2019\"
2018.3.3 Security Fix | Version: 18.3.3.18 | Build: 20190510_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2018\"
==> Running Revit Instances
PID: 28452 | 2022.1.5 | Version: 22.1.50.17 | Build: 20230915_1530(x64) | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2022"
==> User Environment
Microsoft Windows 10 [Version 10.0.22631]
Executing User: username
Active User: username
Admin Access: No
%APPDATA%: "C:\Users\username\AppData\Roaming"
Latest Installed .Net Framework: 4.8
No .Net Target Packs are installed.
No .Ne-Core Target Packs are installed.
pyRevit CLI v4.8.16.24121+2117.23a0b8cbc4babdeb29a0611e159d017bbe9cbad5

Additional context

No response

@alexdaversa alexdaversa added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Oct 30, 2024
@jmcouffin jmcouffin added the New Feature New feature request [class->Implemented #{number}: {title}] label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] New Feature New feature request [class->Implemented #{number}: {title}]
Projects
None yet
Development

No branches or pull requests

2 participants