<?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: Add-in not shown in &amp;quot;Flat Pattern&amp;quot; in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7551653#M17261</link>
    <description>&lt;P&gt;I am curious as to why the add-in doesn't appear for you on windows but for the moment lets take that as a separate issue and table it for now (although if you figure it out i'd love to know).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;sample add-in you provided has the same behavior as my add-in, for me at least. I can see the item in the sketch menu until I go into "flat pattern" - then it's gone. When i exit flat pattern it returns. This is NOT an issue with simply being in the "Sheet Metal" environment - this is specific to the Flat Pattern "view"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="K0ILc3U" style="width: 369px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/427431iA9622F3A1EF01878/image-size/large?v=v2&amp;amp;px=999" role="button" title="K0ILc3U" alt="K0ILc3U" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a framework to make writing add-ins less tedious so sharing my code would require a good bit of diving in and since the simple sample you shared exhibits the behavior I don't think we're at that point yet - although I'm more than willing to share my code. None the less here's a snip of my button creation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my add-in class:&lt;/P&gt;&lt;PRE&gt;  def add_button(self):
    self.remove_button()
    button = super().add_button()
    button.toolClipFilename = os.path.join(self.resource_dir, 'captions/Thumb.png')
    panel = self.ui.allToolbarPanels.itemById('SketchPanel')
    panel.controls.addCommand(button)
    button.isPromotedByDefault = True
    button.isPromoted = True
    return button

  def remove_button(self):
    button = self.ui.commandDefinitions.itemById(self.command_id)
    panel = self.ui.allToolbarPanels.itemById('SketchPanel')
    button_control = panel.controls.itemById(self.command_id)
    if button:
      button.deleteMe()
    if button_control:
      button_control.deleteMe()&lt;/PRE&gt;&lt;P&gt;And in my base class (which the above code calls via super...)&lt;/P&gt;&lt;PRE&gt;  def add_button(self):
    """Called at an appropriate time to add a button to one of Fusions menus.

    Overriders of this method should call super(), then they can add the button to the Fusion menu system if desired.
    Finally the button object must be returned.
    Returns:
      ButtonDefinition
    """
    return self.ui.commandDefinitions.addButtonDefinition(
      self.command_id,
      self.command_name,
      self.command_description,
      self.resource_dir)&lt;/PRE&gt;</description>
    <pubDate>Fri, 17 Nov 2017 01:54:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-11-17T01:54:16Z</dc:date>
    <item>
      <title>Add-in not shown in "Flat Pattern"</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7540174#M17259</link>
      <description>&lt;P&gt;My DXF For Laser add-in appears in the sketch menu normally, however, when in Flat Pattern view it is not displayed. I even have it pinned to the top toolbar and it is also removed in flat view. Dumping the toolbar info doesn't provide any insight - apart from flat pattern NOT having an "environment" which smells of a hack and I found an unrelated typo "SheetetalCreatePanel" (instead of&amp;nbsp;Sheet&lt;STRONG&gt;M&lt;/STRONG&gt;etalCreatePanel).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any solutions / workarounds out there?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 18:32:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7540174#M17259</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-13T18:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add-in not shown in "Flat Pattern"</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7548256#M17260</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just had the addin "DXF4Laser" (version 1.1.1) in my machines and gave a quick try. Unfortunately I cannot see the menu "Save DXF for Laser Cutting" in sketch panel of both "Model" and "Sheet Metal" in my Windows machine. However it&amp;nbsp;worked well in my MAC machine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did testing that the following codes worked well in both machines.&amp;nbsp;Please check if something was wrong in your addin. I&amp;nbsp;found the calling to set control promotion was wrong in your addin.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import adsk.core, adsk.fusion, adsk.cam, traceback

ui = None

def run(context):
    try:
        app = adsk.core.Application.get()
        global ui
        ui  = app.userInterface
        
        mycmd = ui.commandDefinitions.addButtonDefinition('MyCommand', 'My Command', '', '')
        panel = ui.allToolbarPanels.itemById('SketchPanel')
        mycontrol = panel.controls.addCommand(mycmd)
        mycontrol.isPromotedByDefault = True
        mycontrol.isPromoted = True

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def stop(context):
    try: 
        mycmd = ui.commandDefinitions.itemById('MyCommand')
        panel = ui.allToolbarPanels.itemById('SketchPanel')
        mycontrol = panel.controls.itemById('MyCommand')
        if mycmd:
            mycmd.deleteMe()
        if mycontrol:
            mycontrol.deleteMe()

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Nov 2017 02:25:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7548256#M17260</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2017-11-16T02:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Add-in not shown in "Flat Pattern"</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7551653#M17261</link>
      <description>&lt;P&gt;I am curious as to why the add-in doesn't appear for you on windows but for the moment lets take that as a separate issue and table it for now (although if you figure it out i'd love to know).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;sample add-in you provided has the same behavior as my add-in, for me at least. I can see the item in the sketch menu until I go into "flat pattern" - then it's gone. When i exit flat pattern it returns. This is NOT an issue with simply being in the "Sheet Metal" environment - this is specific to the Flat Pattern "view"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="K0ILc3U" style="width: 369px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/427431iA9622F3A1EF01878/image-size/large?v=v2&amp;amp;px=999" role="button" title="K0ILc3U" alt="K0ILc3U" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a framework to make writing add-ins less tedious so sharing my code would require a good bit of diving in and since the simple sample you shared exhibits the behavior I don't think we're at that point yet - although I'm more than willing to share my code. None the less here's a snip of my button creation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my add-in class:&lt;/P&gt;&lt;PRE&gt;  def add_button(self):
    self.remove_button()
    button = super().add_button()
    button.toolClipFilename = os.path.join(self.resource_dir, 'captions/Thumb.png')
    panel = self.ui.allToolbarPanels.itemById('SketchPanel')
    panel.controls.addCommand(button)
    button.isPromotedByDefault = True
    button.isPromoted = True
    return button

  def remove_button(self):
    button = self.ui.commandDefinitions.itemById(self.command_id)
    panel = self.ui.allToolbarPanels.itemById('SketchPanel')
    button_control = panel.controls.itemById(self.command_id)
    if button:
      button.deleteMe()
    if button_control:
      button_control.deleteMe()&lt;/PRE&gt;&lt;P&gt;And in my base class (which the above code calls via super...)&lt;/P&gt;&lt;PRE&gt;  def add_button(self):
    """Called at an appropriate time to add a button to one of Fusions menus.

    Overriders of this method should call super(), then they can add the button to the Fusion menu system if desired.
    Finally the button object must be returned.
    Returns:
      ButtonDefinition
    """
    return self.ui.commandDefinitions.addButtonDefinition(
      self.command_id,
      self.command_name,
      self.command_description,
      self.resource_dir)&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Nov 2017 01:54:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7551653#M17261</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-17T01:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add-in not shown in "Flat Pattern"</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7551739#M17262</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for detailed information. I agree it should be separate issue which the menu didn't appear under sketch panel in my machine. Now I can reproduce your issue in my mac machine. I misunderstood "Flat Pattern" view. I will log a defect against the issue in our internal bug system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 03:32:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7551739#M17262</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2017-11-17T03:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add-in not shown in "Flat Pattern"</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7551752#M17263</link>
      <description>&lt;P&gt;Ya, I had to take a moment to understand my user's complaint about this myself &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 03:46:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/7551752#M17263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-17T03:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Add-in not shown in "Flat Pattern"</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/13612119#M17264</link>
      <description>&lt;P&gt;Was this ever resolved? I'm having a hard time finding the flat pattern menus in allToolbarTabs/allToolbarPanels.&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2025 11:06:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/add-in-not-shown-in-quot-flat-pattern-quot/m-p/13612119#M17264</guid>
      <dc:creator>thomasa88</dc:creator>
      <dc:date>2025-05-03T11:06:59Z</dc:date>
    </item>
  </channel>
</rss>

