<?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 API Bug occurrence.isLightBulbOn did not work properly in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/9531468#M11624</link>
    <description>&lt;P&gt;Dear support,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Could you please check the attached python script which demonstrates incorrect behavior of the&amp;nbsp;occurrence.isLightBulbOn flag.&lt;BR /&gt;&lt;BR /&gt;isLightBulbOn flag can not be set to &lt;STRONG&gt;False&lt;/STRONG&gt; programmatically for the elements which parent has eye icon turned off in a Fusion Browser.&lt;BR /&gt;When I tried to set it to True(isLightBulbOn=True) the API change&amp;nbsp;eye icon from 'on' to 'off' and from 'off' to 'on' on each API call instead of enabling&amp;nbsp;eye icon.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_2.png" style="width: 970px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/773778i61E0D75A03257ADB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_2.png" alt="Screenshot_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 May 2020 10:57:37 GMT</pubDate>
    <dc:creator>akonovalenko</dc:creator>
    <dc:date>2020-05-21T10:57:37Z</dc:date>
    <item>
      <title>API Bug occurrence.isLightBulbOn did not work properly</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/9531468#M11624</link>
      <description>&lt;P&gt;Dear support,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Could you please check the attached python script which demonstrates incorrect behavior of the&amp;nbsp;occurrence.isLightBulbOn flag.&lt;BR /&gt;&lt;BR /&gt;isLightBulbOn flag can not be set to &lt;STRONG&gt;False&lt;/STRONG&gt; programmatically for the elements which parent has eye icon turned off in a Fusion Browser.&lt;BR /&gt;When I tried to set it to True(isLightBulbOn=True) the API change&amp;nbsp;eye icon from 'on' to 'off' and from 'off' to 'on' on each API call instead of enabling&amp;nbsp;eye icon.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_2.png" style="width: 970px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/773778i61E0D75A03257ADB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_2.png" alt="Screenshot_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 10:57:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/9531468#M11624</guid>
      <dc:creator>akonovalenko</dc:creator>
      <dc:date>2020-05-21T10:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: API Bug occurrence.isLightBulbOn did not work properly</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/9535637#M11625</link>
      <description>&lt;P&gt;I understand it might be looking odd. The visibility of child components are dependent on parent component visibility. If parent component visibility is false then child component visibility is ignored. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you turn off visibility of parent component and query visibility of the child component then it is returning false but it is showing 'on' in browser which is right. Because of this difference it goes out of sync and you notice the behaviour what you mentioned in your post. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure showing whether this property should give the status of the browser or in canvas because it still be confusing for some user whether they will see the component is invisible in canvas but this property is returning true, the status in browser.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2020 12:35:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/9535637#M11625</guid>
      <dc:creator>goyals</dc:creator>
      <dc:date>2020-05-23T12:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: API Bug occurrence.isLightBulbOn did not work properly</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/9538248#M11626</link>
      <description>&lt;P&gt;The&amp;nbsp;Occurrence Object has another attribute&amp;nbsp;&lt;STRONG&gt;isVisible&lt;/STRONG&gt; which response for it visibility in&amp;nbsp;&lt;SPAN&gt;canvas&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-fbf29660-bff9-4062-93f8-1fcbe4b8c51c" target="_blank"&gt;https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-fbf29660-bff9-4062-93f8-1fcbe4b8c51c&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and&amp;nbsp;&lt;STRONG&gt;isLightBulbOn &lt;/STRONG&gt;according to the documentation&amp;nbsp;&lt;A href="http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-203a9b47-df8f-4373-9535-b3df3d8e558f" target="_blank"&gt;http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-203a9b47-df8f-4373-9535-b3df3d8e558f&lt;/A&gt;&amp;nbsp;is about browser&lt;BR /&gt;"&lt;SPAN&gt;Gets and sets if the light bulb of this occurrence as displayed in the &lt;STRONG&gt;browser&lt;/STRONG&gt; is &lt;STRONG&gt;on&lt;/STRONG&gt; or &lt;STRONG&gt;off&lt;/STRONG&gt;&lt;/SPAN&gt;"&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 13:30:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/9538248#M11626</guid>
      <dc:creator>akonovalenko</dc:creator>
      <dc:date>2020-05-25T13:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: API Bug occurrence.isLightBulbOn did not work properly</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/13651173#M21825</link>
      <description>&lt;P&gt;Sorry to necro an old post but this is absolutely broken and still is in 2025(!!!) and this is the only post I can find on the topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The occurrence.isLightBulbOn function is bugged &lt;/SPAN&gt;&lt;SPAN&gt;and gives the same result as&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;occurrence.isVisible. In other words, calling&amp;nbsp;&lt;SPAN&gt;occurrence.isLightBulbOn on a child occurrence whose parent's light bulb is off, returns False regardless of the actual light bulb state of the child. What's more, when a attempting to use the function to set the state on a child occurrence whose parent's light bulb is off is also broken. When attempting this, occurrence.isLightBulbOn = False has no effect, as the original post describes, but also,&amp;nbsp;occurrence.isLightBulbOn = True adopts a toggle behaviour and will switch false to to true and true to false depending on the starting state of the child. AAAAGGGGGGGHHHHHHHHHHH.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;How is it possible for this to be so broken for so long and nobody care?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm running this python script on the latest version of Fusion:&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="general"&gt;import traceback
import adsk.core
import adsk.fusion

# Initialize the global variables for the Application and UserInterface objects.
app = adsk.core.Application.get()
ui = app.userInterface


def run(_context: str):
    try:
        allOccurrences = app.activeProduct.rootComponent.allOccurrences
        msg = "Before!"

        for occurrence in allOccurrences:
            msg = msg + "\noccurance name: " + occurrence.name + "\noccurrence.isLightBulbOn = " + \
                str(occurrence.isLightBulbOn) + "\noccurrence.isVisible = " + \
                str(occurrence.isVisible)

        ui.messageBox(msg)

        for index, occurrence in enumerate(allOccurrences):
            if index % 2 != 0:
                occurrence.isLightBulbOn = True

        msg = "After!"

        for occurrence in allOccurrences:
            msg = msg + "\noccurance name: " + occurrence.name + "\noccurrence.isLightBulbOn = " + \
                str(occurrence.isLightBulbOn) + "\noccurrence.isVisible = " + \
                str(occurrence.isVisible)

        ui.messageBox(msg)
    except:
        ui.messageBox(f'Failed:\n{traceback.format_exc()}')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above script iterates through all occurrences, logs the result of isLightBulbOn and isVisible and then displays those results in a message box. It then attempts to set isLightBulbOn to True on the odd numbered occurrences in the list (in this case it's one of the child occurrences). Finally it logs the isLightBulbOn and isVisible results again and displays another message box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run it on a simple project with a parent component containing two child occurrences, with all eyes (light bulbs) manually switched on, the script runs as expected, no surprises:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alasdair_scott2DJBH_1-1748335905092.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1537553i8F13E4E96E7ED870/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alasdair_scott2DJBH_1-1748335905092.png" alt="alasdair_scott2DJBH_1-1748335905092.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the script has attempted to set isLightBulbOn to True, again no surprises:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alasdair_scott2DJBH_2-1748335935869.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1537554iCCDFBDC76297A450/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alasdair_scott2DJBH_2-1748335935869.png" alt="alasdair_scott2DJBH_2-1748335935869.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When running the script with just the parent light bulb manually switched off, here we see everything returns false when isLightBulbOn for the children should return True:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alasdair_scott2DJBH_3-1748336022034.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1537556i9F38B8DFEC91AC77/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alasdair_scott2DJBH_3-1748336022034.png" alt="alasdair_scott2DJBH_3-1748336022034.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And finally, after the script attempts to set isLightBulbOn = True on Component3:1, which was already set to true, you can see that it's actually flipped it to false:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alasdair_scott2DJBH_4-1748336189888.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1537557i528081EC192A0DAD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alasdair_scott2DJBH_4-1748336189888.png" alt="alasdair_scott2DJBH_4-1748336189888.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script and example project attached.&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2025 09:05:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/13651173#M21825</guid>
      <dc:creator>alasdair_scott2DJBH</dc:creator>
      <dc:date>2025-05-27T09:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: API Bug occurrence.isLightBulbOn did not work properly</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/13652502#M21828</link>
      <description>&lt;P&gt;I can reproduce this problem and will make sure a bug is logged.&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2025 23:41:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/13652502#M21828</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2025-05-27T23:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: API Bug occurrence.isLightBulbOn did not work properly</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/13976439#M22503</link>
      <description>&lt;P&gt;Hi Brian, I’m experiencing a similar issue with my add-in. Has this been fixed, or am I still dealing with the same sub-component visibility problem?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2026 14:25:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/api-bug-occurrence-islightbulbon-did-not-work-properly/m-p/13976439#M22503</guid>
      <dc:creator>sebastien_denoncourt</dc:creator>
      <dc:date>2026-01-14T14:25:18Z</dc:date>
    </item>
  </channel>
</rss>

