fusion-360-total-exporter icon indicating copy to clipboard operation
fusion-360-total-exporter copied to clipboard

Failed: The selected folder is not accessible

Open kraegar opened this issue 4 years ago • 19 comments

image image

kraegar avatar Sep 18 '20 02:09 kraegar

This is like a 6 levels deep sub component so my best guess here is you're trampling over the 260 character file path limit in Windows. Try this and see if you get the same error.

Jnesselr avatar Sep 18 '20 02:09 Jnesselr

I got this as well but I have long paths enabled since before (Win10). I also sometimes get this when using save as in fusion but as just a brief warning from fusion and then all is ok again. Would it be possible just to skip since now script has to start over again? I can try to save directly to d:\ instead so I at least can shorten the local path. Did not help with shorter local path. Error 2b

Gnindit avatar Sep 18 '20 05:09 Gnindit

The only things common so far I have to go on are that you're both on windows, you're both writing to the D:\ drive, and this is writing to several levels deep. Updated guess is that somehow a parent folder doesn't get made and this fails here with this error.

Jnesselr avatar Sep 18 '20 16:09 Jnesselr

Scanned path length and we are up to about 150 characters on the local drive. So not so close to 256.

Maybe this is the problem? You can name things the same but Fusion puts an ending on it to keep them separate. But the script strips the ending :x from it when making folders and then the folder already exists. They seem to be copies of each other and linked somehow since the can be right clicked and then option to make independent is there. I have no idea if script handles this as only one download or multiple, or how it should be for it to work.

image

Gnindit avatar Sep 18 '20 20:09 Gnindit

Same problem here, too. (exact same stacktrace as others) image

A skip or resume option would be wonderful. Even a "log successes to one file, errors to another", so that this tool can export all the normal files, and the few weird edge cases can be exported manually.

MrTrick avatar Sep 18 '20 23:09 MrTrick

FWIW, I was able to work around this by plugging in a USB3.1 drive and writing the files to that. Both the usb drive and my C drive were formatted NTFS and had similar path depth so no idea why this worked but I'm happy! I had like 200 projects I had to export. Thanks so much for the script.

Tailslide avatar Sep 19 '20 03:09 Tailslide

Ran it now with latest update that I think also replaces the ":".

Path not found. But as you can see it is searching for "\BF12 Mount X "\ notice the space at the end of the folder name that its trying to find. Windows takes away trailing spaces when folders are made. image

I can test but would be nice to test on specific design so I do not have to wait 30 min each time until it reaches the problem one. image

Gnindit avatar Sep 19 '20 07:09 Gnindit

You can Enable Win23 long paths via Group Policy Editor. I will try this if the script fails again. Google for it. Open Group Policy Editor (Press Windows Key and type gpedit.msc and hit Enter key. Navigate to the following directory: Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS. Click Enable NTFS long paths option and enable it.

3d-gussner avatar Sep 19 '20 08:09 3d-gussner

You can Enable Win23 long paths via Group Policy Editor. I will try this if the script fails again. Google for it. Open Group Policy Editor (Press Windows Key and type gpedit.msc and hit Enter key. Navigate to the following directory: Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS. Click Enable NTFS long paths option and enable it.

Is that the same as enabling long path in registry? Dator\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled = 1 If so that is not the problem. Also the path (at least locally) is around 150.

Gnindit avatar Sep 19 '20 08:09 Gnindit

You can Enable Win23 long paths via Group Policy Editor. I will try this if the script fails again. Google for it. Open Group Policy Editor (Press Windows Key and type gpedit.msc and hit Enter key. Navigate to the following directory: Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem > NTFS. Click Enable NTFS long paths option and enable it.

Is that the same as enabling long path in registry? Dator\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled = 1 If so that is not the problem. Also the path (at least locally) is around 150.

I guess yes. But not sure if a "windows update" will overwrite it, so I stick with the GP even this can be "fixed/updated" by Windows Update.

Running it now with these settings after 5 approaches ending up in the root of a drive and still failing.

I will update here my results.

3d-gussner avatar Sep 19 '20 08:09 3d-gussner

And failed again even with "NTFS long paths option" enabled.

---------------------------
Fusion 360
---------------------------
Failed:
Traceback (most recent call last):
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 217, in run
    total_export.run(context)
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 69, in run
    self._write_data_file(output_path, file)
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 125, in _write_data_file
    self._write_component(file_folder_path, design.rootComponent)
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 151, in _write_component
    self._write_component(sub_path, sub_component)
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 151, in _write_component
    self._write_component(sub_path, sub_component)
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 151, in _write_component
    self._write_component(sub_path, sub_component)
  [Previous line repeated 2 more times]
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 138, in _write_component
    self._write_stl(output_path, component)
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 173, in _write_stl
    self._take(output_path)
  File "D:/Data/Github/Fusion360/Total_exporter/master/Fusion 360 Total Export.py", line 203, in _take
    os.makedirs(out_path, exist_ok=True)
  File "C:/Users/<username>/AppData/Local/Autodesk/webdeploy/production/<some numbers>/Python/lib\os.py", line 221, in makedirs
    mkdir(name, mode)
FileNotFoundError: [WinError 206] The filename or extension is too long: 'D:/Hub 3d Gussner\\Project 140100\\140100\\141001\\140100E3DMCLR600SQ.f3d\\140100E3DMCLR600SQ v4\\SSTTopassXYasE3DMCLR v26\\SSTTOPPLATE5DE3DMCLR v18\\SSTLangepillarNema23Z14E3DMCLR v5\\NEMA23 57BYGH627 v1\\pan head cross recess screwisoISO 7045  M3 x 30  Z  25C'

---------------------------
OK   
---------------------------

3d-gussner avatar Sep 19 '20 08:09 3d-gussner

After renaming the "pan head cross recess screwisoISO 7045 M3 x 30 Z 25C" to something shorter without spaces the script could continue .... waiting what happens next

3d-gussner avatar Sep 19 '20 09:09 3d-gussner

I have found this https://github.com/Jnesselr/fusion-360-total-exporter/pull/14#issuecomment-695201180

Gnindit avatar Sep 19 '20 11:09 Gnindit

After long time working fine it crashed again... merged the Bozzzo changes and hope this will help.

3d-gussner avatar Sep 19 '20 11:09 3d-gussner

Here some stats of my 1st project (still not finished):

  • 4.8GB
  • 12.765 Files
  • 2.586 Folders

3d-gussner avatar Sep 19 '20 11:09 3d-gussner

After doing well Fusion360 crashed! Restart .... image

3d-gussner avatar Sep 19 '20 13:09 3d-gussner

As a workaround not to start from the beginning I modified the script: from for project_index in range(all_projects.count): to for project_index in range(5, all_projects.count): Then it starts at project 6 instead running all previous finished.

3d-gussner avatar Sep 19 '20 13:09 3d-gussner

This now seems to work for me def _name(self, name): return re.sub('[^a-zA-Z0-9 \n\.]', '', name).strip()

Gnindit avatar Sep 19 '20 15:09 Gnindit

Hello, I just want to confirm that the workaround proposed by @Tailslide to export to usb seems to work correctly for me. Nor can I find a technical explanation for it.

beer73 avatar Jan 29 '21 11:01 beer73