<?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: Can anyone think of an elegant way to pop open the file dialogue? in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/can-anyone-think-of-an-elegant-way-to-pop-open-the-file-dialogue/m-p/9769518#M10650</link>
    <description>&lt;P&gt;I would use a BoolValueCommandInput.&amp;nbsp; This shows up in the dialog as a button.&amp;nbsp; This is what the various import commands in Fusion use, like the "Insert DXF" command.&amp;nbsp; They use a folder icon for the button.&amp;nbsp; You can react when the button is clicked and display a file dialog to get the filename and then save that filename in a global variable.&amp;nbsp; When the OK button is clicked you can do something with the filename in the execute event.&amp;nbsp; I've attached a simple add-in that demonstrates this.&lt;/P&gt;</description>
    <pubDate>Sat, 26 Sep 2020 02:15:51 GMT</pubDate>
    <dc:creator>BrianEkins</dc:creator>
    <dc:date>2020-09-26T02:15:51Z</dc:date>
    <item>
      <title>Can anyone think of an elegant way to pop open the file dialogue?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/can-anyone-think-of-an-elegant-way-to-pop-open-the-file-dialogue/m-p/9768028#M10649</link>
      <description>&lt;P&gt;I'm giving users an interface to read or write data, but I need them to make decisions as well as give me a new/existing file to write/read - I can't just throw them directly into&amp;nbsp;createFileDialog().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One idea I had, was to detect them clicking on something (e.g. "Select File") in with their options, which grabs the name of the file, then when they click "OK", it performs the complex actions based on their input with the file they gave:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-09-25 at 9.29.38 pm.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/823593i48E91B407C9B6CA1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-09-25 at 9.29.38 pm.png" alt="Screen Shot 2020-09-25 at 9.29.38 pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I can't find any way to detect them clicking on anything that looks nice.&amp;nbsp; I've tried&amp;nbsp;ImageCommandInput and&amp;nbsp;TextBoxCommandInput (with an &amp;lt;img&amp;gt; tag) and&amp;nbsp;TextBoxCommandInput that contains an HTML form - but while they all look pretty, they do nothing (I can't detect any events firing).&amp;nbsp; Ideally, does anyone know how to use JavaScript or &amp;lt;forms&amp;gt; inside&amp;nbsp;TextBoxCommandInput to "talk" to my add-in?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Logically, I *could* wait for the "OK" and *then* ask the file, but that's going to confuse them to no-end (who clicks "OK" to import from a file, without selecting a file first? counter-intuitive!).&amp;nbsp; I could ask for the file first, but that too will confuse because the flow doesn't make sense before the other decisions they need to make.&amp;nbsp; I could use some other control, like a&amp;nbsp;ButtonRowCommandInput - except that's a 16x16 pixel icon, which - while working - will basically look stupid...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas anyone?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 11:43:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/can-anyone-think-of-an-elegant-way-to-pop-open-the-file-dialogue/m-p/9768028#M10649</guid>
      <dc:creator>OceanHydroAU</dc:creator>
      <dc:date>2020-09-25T11:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone think of an elegant way to pop open the file dialogue?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/can-anyone-think-of-an-elegant-way-to-pop-open-the-file-dialogue/m-p/9769518#M10650</link>
      <description>&lt;P&gt;I would use a BoolValueCommandInput.&amp;nbsp; This shows up in the dialog as a button.&amp;nbsp; This is what the various import commands in Fusion use, like the "Insert DXF" command.&amp;nbsp; They use a folder icon for the button.&amp;nbsp; You can react when the button is clicked and display a file dialog to get the filename and then save that filename in a global variable.&amp;nbsp; When the OK button is clicked you can do something with the filename in the execute event.&amp;nbsp; I've attached a simple add-in that demonstrates this.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 02:15:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/can-anyone-think-of-an-elegant-way-to-pop-open-the-file-dialogue/m-p/9769518#M10650</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2020-09-26T02:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can anyone think of an elegant way to pop open the file dialogue?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/can-anyone-think-of-an-elegant-way-to-pop-open-the-file-dialogue/m-p/9769537#M10651</link>
      <description>&lt;P&gt;@Brilliant pointer - thanks Brian.&amp;nbsp; I did basically that same thing, but I prefer the icon and wording that Fusion360 is using for this same issue (thanks for pointing me at DXF!) so I'm going to change my UI to match those.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-09-26 at 12.44.55 pm.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/823928i69C499CFC691B0BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-09-26 at 12.44.55 pm.png" alt="Screen Shot 2020-09-26 at 12.44.55 pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-09-26 at 12.44.12 pm.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/823929i957C2796E64108F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-09-26 at 12.44.12 pm.png" alt="Screen Shot 2020-09-26 at 12.44.12 pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 02:48:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/can-anyone-think-of-an-elegant-way-to-pop-open-the-file-dialogue/m-p/9769537#M10651</guid>
      <dc:creator>OceanHydroAU</dc:creator>
      <dc:date>2020-09-26T02:48:21Z</dc:date>
    </item>
  </channel>
</rss>

