Jnesselr / fusion-360-total-exporter

Need to export all of your fusion data in a bunch of formats? We've got you covered
286 stars 45 forks source link

Failed: The selected folder is not accessible #4

Open kraegar opened 4 years ago

kraegar commented 4 years ago

image image

Jnesselr commented 4 years ago

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.

Gnindit commented 4 years ago

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

Jnesselr commented 4 years ago

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.

Gnindit commented 4 years ago

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

MrTrick commented 4 years ago

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.

Tailslide commented 4 years ago

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.

Gnindit commented 3 years ago

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

3d-gussner commented 3 years ago

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.

Gnindit commented 3 years ago

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.

3d-gussner commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

Gnindit commented 3 years ago

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

3d-gussner commented 3 years ago

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

3d-gussner commented 3 years ago

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

3d-gussner commented 3 years ago

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

3d-gussner commented 3 years ago

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.

Gnindit commented 3 years ago

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

beer73 commented 3 years ago

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.