Message 1 of 5
Bug when getting toolbar panel names from Sketch Toolbar Tab in the Design Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I wrote a tiny script for getting the name of each toolbar panel from each toolbar tab in the design workspace as follows:
# Script to get all toolbar tabs in the active workspace and write them to a file for RAG to read.
import adsk.core
app = adsk.core.Application.get()
ui = app.userInterface
tab = ui.activeWorkspace.toolbarTabs.itemById("SurfaceTab")
toolbar_panels = tab.toolbarPanels
for tbp in toolbar_panels:
print(tbp.name)
This script works perfectly for all (visible) toolbar tabs in the Design workspace except for the Surface toolbar tab where the following error is found:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 11, in <module>
File "/Users/robertdickson/Library/Application Support/Autodesk/webdeploy/production/e379c5f768f16e4cbcd81b81fe59a8562f304f19/Autodesk Fusion 360.app/Contents/Api/Python/packages/adsk/core.py", line 18710, in __iter__
yield self.item(i)
^^^^^^^^^^^^
File "/Users/robertdickson/Library/Application Support/Autodesk/webdeploy/production/e379c5f768f16e4cbcd81b81fe59a8562f304f19/Autodesk Fusion 360.app/Contents/Api/Python/packages/adsk/core.py", line 18744, in item
return _core.ToolbarPanels_item(self, index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 2 : InternalValidationError : item
Weirdly it seems to be able to get the "Create" and "Modify" Panels before failing.
Please could this error be addressed?
Thanks!
Robert