<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bug when getting toolbar panel names from Sketch Toolbar Tab in the Design Workspace in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12441546#M2377</link>
    <description>&lt;P&gt;Hello - just wanted to inform you that this has been identified as a bug and should be fixed in an upcoming release (probably not the next one). Thank you for posting!&lt;BR /&gt;&lt;BR /&gt;In the meantime, you can work around this issue utilizing array iteration and checking if panel is null. Something like:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;for index in range(toolbar_panels.count):
    tbp = toolbar_panels[index]
    if tbp:
        app.log(tbp.name)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 15:51:56 GMT</pubDate>
    <dc:creator>john.kirchner</dc:creator>
    <dc:date>2023-12-14T15:51:56Z</dc:date>
    <item>
      <title>Bug when getting toolbar panel names from Sketch Toolbar Tab in the Design Workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12412700#M2373</link>
      <description>&lt;P&gt;Hi, I wrote a tiny script for getting the name of each toolbar panel from each toolbar tab in the design workspace as follows:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;# 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)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Traceback (most recent call last):
  File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "&amp;lt;string&amp;gt;", line 11, in &amp;lt;module&amp;gt;
  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&lt;/LI-CODE&gt;&lt;P&gt;Weirdly it seems to be able to get the "Create" and "Modify" Panels before failing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please could this error be addressed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 08:45:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12412700#M2373</guid>
      <dc:creator>robertASTUP</dc:creator>
      <dc:date>2023-12-01T08:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bug when getting toolbar panel names from Sketch Toolbar Tab in the Design Workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12413425#M2374</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13615829"&gt;@robertASTUP&lt;/a&gt;&amp;nbsp;-San.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There seems to be something present that is not being displayed.&lt;/P&gt;
&lt;P&gt;Try the following modification and execute it.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;・・・
        toolbar_panels = tab.toolbarPanels
        # for tbp in toolbar_panels:
        #     print(tbp.name)

        for idx in range(len(toolbar_panels)):
            try:
                tbp = toolbar_panels[idx]
                print(tbp.name)
            except:
                print(f"error - index:{idx}")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Dec 2023 15:15:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12413425#M2374</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2023-12-01T15:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bug when getting toolbar panel names from Sketch Toolbar Tab in the Design Workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12417440#M2375</link>
      <description>&lt;P&gt;-&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 07:57:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12417440#M2375</guid>
      <dc:creator>robertASTUP</dc:creator>
      <dc:date>2023-12-04T07:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Bug when getting toolbar panel names from Sketch Toolbar Tab in the Design Workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12417444#M2376</link>
      <description>&lt;P&gt;Hi, thanks for your reply. This unfortunately produces the same error. The error still occurs at line 6 of your code and is a problem with the generator. I can see from the other toolbar tabs and panels printed that it is a problem with the "Assemble" toolbar panel in the "Surface" toolbar tab. For information that may be useful, I am on the latest version of Fusion 360 on MacOS.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 07:56:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12417444#M2376</guid>
      <dc:creator>robertASTUP</dc:creator>
      <dc:date>2023-12-04T07:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Bug when getting toolbar panel names from Sketch Toolbar Tab in the Design Workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12441546#M2377</link>
      <description>&lt;P&gt;Hello - just wanted to inform you that this has been identified as a bug and should be fixed in an upcoming release (probably not the next one). Thank you for posting!&lt;BR /&gt;&lt;BR /&gt;In the meantime, you can work around this issue utilizing array iteration and checking if panel is null. Something like:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;for index in range(toolbar_panels.count):
    tbp = toolbar_panels[index]
    if tbp:
        app.log(tbp.name)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 15:51:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/bug-when-getting-toolbar-panel-names-from-sketch-toolbar-tab-in/m-p/12441546#M2377</guid>
      <dc:creator>john.kirchner</dc:creator>
      <dc:date>2023-12-14T15:51:56Z</dc:date>
    </item>
  </channel>
</rss>

