Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export 3d model tries to write into root directory / #175

Open
VK2BEA opened this issue Jun 17, 2023 · 4 comments
Open

Export 3d model tries to write into root directory / #175

VK2BEA opened this issue Jun 17, 2023 · 4 comments

Comments

@VK2BEA
Copy link

VK2BEA commented Jun 17, 2023

I've probably failed to initialize something in the preferences but recently I've been unable to export 3D (wml or step) because the 'Export 3D model' command tries to write in the root directory.
How do I define where to write the model? (It doesn't ask at the time of execution)

This is using the nightly FeeCAD 0.21.0 (KiCadStepUp 10.19.4)

Running the Python command 'ksuToolsExportModel' failed:
Traceback (most recent call last):
  File "/home/michael/.local/share/FreeCAD/Mod/kicadStepUpMod/./kicadStepUpCMD.py", line 1266, in Activated
    routineScaleVRML()
  File "/home/michael/.local/share/FreeCAD/Mod/kicadStepUpMod/./kicadStepUptools.py", line 7412, in routineScaleVRML
    lbl=go_export(fullFilePathName)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/michael/.local/share/FreeCAD/Mod/kicadStepUpMod/./kicadStepUptools.py", line 2684, in go_export
    export(objs, fPathName, 0.3937, lbl)
  File "/home/michael/.local/share/FreeCAD/Mod/kicadStepUpMod/./kicadStepUptools.py", line 2345, in export
    exportVRMLmaterials(meshes, filename)
  File "/home/michael/.local/share/FreeCAD/Mod/kicadStepUpMod/./kicadStepUptools.py", line 2041, in exportVRMLmaterials
    with builtin.open(fpath, 'w') as f: #py3
         ^^^^^^^^^^^^^^^^^^^^^^^^

[Errno 13] Permission denied: '/Molex-1625.IC260A001.wrl'
@VK2BEA
Copy link
Author

VK2BEA commented Jun 17, 2023

OK, it seems like there is a subtle bug...
If FreeCAD is started from the command line with the file as an argument ...
$ FreeCAD Molex-1625.IC260A.FCStd
this problem occurs.
If FreeCAD is started without an argument and then the file is opened explicitly when in FreeCAD, the 3D models are saved in the same directory as the FCStd file.

@easyw
Copy link
Owner

easyw commented Jun 17, 2023

@VK2BEA
thank you for your detailed feedback...
it seems that the document 'filename' includes the full path only if it is opened by menu and not using the command line argument...
As a workaround you can save the file before exporting... this operation will add the full path to document filename, avoiding the error
App.ActiveDocument.FileName

@VK2BEA
Copy link
Author

VK2BEA commented Jun 17, 2023

At least for an existing file, opening and selecting 'save' did not work around this problem; however, using 'save as' and overwriting the same file name did.

@easyw
Copy link
Owner

easyw commented Jun 18, 2023

@VK2BEA
an other option would be to launch the command using the full path for the file i.e.:
$ FreeCAD ~/Documents/Molex-1625.IC260A.FCStd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants