<?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: Return Path of folder in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10354162#M8833</link>
    <description>&lt;P&gt;Did you try the folder property?&amp;nbsp; Change your print statement to this and I think it will be what you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print(folderdlg.folder)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jun 2021 01:23:24 GMT</pubDate>
    <dc:creator>BrianEkins</dc:creator>
    <dc:date>2021-06-01T01:23:24Z</dc:date>
    <item>
      <title>Return Path of folder</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10328804#M8830</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a automated DXF Importer using PLB in the PCB design.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I just started, I am having trouble returning the path of the chosen folder.&lt;BR /&gt;&lt;BR /&gt;I tried using initialDirectory but that didn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Author-Osama
#Description-For Electrical DXFs imports

import adsk.core, adsk.fusion, adsk.cam, traceback
import os


def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        #path = askdirectory(title='Select Folder') # shows dialog box and return the path


        # Creating a Folder Locater
        folderdlg = ui.createFolderDialog()
        folderdlg.title = 'Please select a folder to import DXFs:'
        res = folderdlg.showDialog()

        #Here is my try to print the path
        print(folderdlg.initialDirectory)
        

         if res == adsk.core.DialogResults.DialogOK:
             folder = folderdlg.folder

         else:
             ui.messageBox('No folder is selected.')

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;The Script Proccess (if interested):&lt;BR /&gt;My next step, is to add all DXF's in the folder to a list. After that start the ULP for dxf import and browse in the path given previously. Select the Top file and compare it to the inital list, if the names match, it would select that file and remove it from the current list and add it to another list. Then it chooses the correct layer based on the file name and import it (file name is "1 Top.dxf" it would choose the "1 Top Layer" and import. after that it starts the ULP again and goes to the next file until the initial list is empty.&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 09:09:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10328804#M8830</guid>
      <dc:creator>osamaolabi</dc:creator>
      <dc:date>2021-05-21T09:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Return Path of folder</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10334393#M8831</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10489953"&gt;@osamaolabi&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no knowledge of PCBs, so please forgive me if this is not appropriate for me to write about them.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I believe that the Fusion360 API does not support PCBs. Therefore, it seems unlikely that you will reach your goal.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I noticed that there is a "Run Script" in the PCB functions.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 602px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/922037i1FE04E755C78911D/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;BR /&gt;I don't know what it does or in what format, but it may be a better way to create the functionality you want.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Why don't you ask in the EAGLE Forum?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/eagle-forum/bd-p/3500" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/eagle-forum/bd-p/3500&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 06:45:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10334393#M8831</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-05-24T06:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Return Path of folder</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10343373#M8832</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to figure out how to get the PATH using another method. I will look into the run script option since I never looked into it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I didn't ask in Eagle since there is no API, and I am using API to control the Fusion360. Also I am using Fusion360 not Eagle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 07:40:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10343373#M8832</guid>
      <dc:creator>osamaolabi</dc:creator>
      <dc:date>2021-05-27T07:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Return Path of folder</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10354162#M8833</link>
      <description>&lt;P&gt;Did you try the folder property?&amp;nbsp; Change your print statement to this and I think it will be what you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print(folderdlg.folder)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 01:23:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10354162#M8833</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2021-06-01T01:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Return Path of folder</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10354470#M8835</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help, This indeed works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you have a wonderful day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 05:11:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/return-path-of-folder/m-p/10354470#M8835</guid>
      <dc:creator>osamaolabi</dc:creator>
      <dc:date>2021-06-01T05:11:38Z</dc:date>
    </item>
  </channel>
</rss>

